From 5e828d232583c5817f90f1d48552a25c296b2e0f Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 24 Jan 2018 11:57:57 -0800 Subject: [PATCH] add HostHasSourceTextAvailable hook --- proposal.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proposal.html b/proposal.html index 514be5e..f9e7b61 100644 --- a/proposal.html +++ b/proposal.html @@ -523,6 +523,13 @@

(19.2.1.1.1) Runtime + +

HostHasSourceTextAvailable ( _func_ )

+

HostHasSourceTextAvailable is an implementation-defined abstract operation that allows host environments to prevent the source text from being provided for a given function.

+

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*.

+
+ +

(19.2.3.5) Function.prototype.toString ( )

@@ -549,7 +556,7 @@

(19.2.3.5) Func 1. If _func_ is a Bound Function exotic object or a built-in Function object, 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 Well-known Intrinsic Object, 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, then return _func_.[[SourceText]]. + 1. If _func_ has a [[SourceText]] internal slot and Type(_func_.[[SourceText]]) is String and ? HostHasSourceTextAvailable(_func_), 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.