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

Commit

Permalink
make HostHasSourceTextAvailable idempotent and never abrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Mar 6, 2018
1 parent d01891a commit cef8e1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proposal.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ <h1>(<emu-xref href="#sec-createdynamicfunction">19.2.1.1.1</emu-xref>) Runtime
<emu-clause id="proposal-sec-hosthassourcetextavailable">
<h1>HostHasSourceTextAvailable ( _func_ )</h1>
<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>
<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>
<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>
</emu-clause>


Expand Down Expand Up @@ -556,7 +556,7 @@ <h1>(<emu-xref href="#sec-function.prototype.tostring">19.2.3.5</emu-xref>) Func
<ins class="block">
<emu-alg>
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_.
1. If _func_ has a [[SourceText]] internal slot and Type(_func_.[[SourceText]]) is String and ? HostHasSourceTextAvailable(_func_), then return _func_.[[SourceText]].
1. If _func_ has a [[SourceText]] internal slot and Type(_func_.[[SourceText]]) is String and ! HostHasSourceTextAvailable(_func_) is *true*, then return _func_.[[SourceText]].
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|.
1. Throw a *TypeError* exception.
</emu-alg>
Expand Down

0 comments on commit cef8e1a

Please sign in to comment.