Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit cef8e1a

Browse files
make HostHasSourceTextAvailable idempotent and never abrupt
1 parent d01891a commit cef8e1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposal.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ <h1>(<emu-xref href="#sec-createdynamicfunction">19.2.1.1.1</emu-xref>) Runtime
526526
<emu-clause id="proposal-sec-hosthassourcetextavailable">
527527
<h1>HostHasSourceTextAvailable ( _func_ )</h1>
528528
<p><ins class="block">HostHasSourceTextAvailable is an implementation-defined abstract operation that allows host environments to prevent the source text from being provided for a given function.</ins></p>
529-
<p><ins class="block">An implementation of HostHasSourceTextAvailable may complete normally or abruptly. Any abrupt completions will be propagated to its callers. The default implementation of HostHasSourceTextAvailable is to unconditionally return a normal completion with a value of *true*.</ins></p>
529+
<p><ins class="block">An implementation of HostHasSourceTextAvailable must complete normally in all cases. This operation must be idempotent. Each time it is called with a specific _func_ as its argument, it must return the same completion record. The default implementation of HostHasSourceTextAvailable is to unconditionally return a normal completion with a value of *true*.</ins></p>
530530
</emu-clause>
531531

532532

@@ -556,7 +556,7 @@ <h1>(<emu-xref href="#sec-function.prototype.tostring">19.2.3.5</emu-xref>) Func
556556
<ins class="block">
557557
<emu-alg>
558558
1. If _func_ is a <emu-xref href="#sec-bound-function-exotic-objects">Bound Function exotic object</emu-xref> or a <emu-xref href="#sec-ecmascript-standard-built-in-objects">built-in Function object</emu-xref>, then return an implementation-dependent String source code representation of _func_. The representation must have the syntax of a |NativeFunction|. Additionally, if _func_ is a <emu-xref href="#sec-well-known-intrinsic-objects">Well-known Intrinsic Object</emu-xref>, the portion of the returned String that would be matched by |IdentifierName| must be the initial value of the *name* property of _func_.
559-
1. If _func_ has a [[SourceText]] internal slot and Type(_func_.[[SourceText]]) is String and ? HostHasSourceTextAvailable(_func_), then return _func_.[[SourceText]].
559+
1. If _func_ has a [[SourceText]] internal slot and Type(_func_.[[SourceText]]) is String and ! HostHasSourceTextAvailable(_func_) is *true*, then return _func_.[[SourceText]].
560560
1. If Type(_func_) is Object and IsCallable(_func_) is *true*, then return an implementation-dependent String source code representation of _func_. The representation must have the syntax of a |NativeFunction|.
561561
1. Throw a *TypeError* exception.
562562
</emu-alg>

0 commit comments

Comments
 (0)