From 8f0f69279b5f9e12ebe8f7052322b93d17e36b54 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Mon, 13 May 2019 17:10:25 -0400 Subject: [PATCH] Normative: Disallow internal methods returning continue|break|return (#1539) I.e., disallow internal methods from returning abrupt completions with [[Type]] = continue or break or return. Somewhat casually in 6.1.7.2, and then more formally in 6.1.7.3. Resolves #1537. --- spec.html | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/spec.html b/spec.html index 80bf41f6fe..19530ef8ea 100644 --- a/spec.html +++ b/spec.html @@ -1353,7 +1353,7 @@

Object Internal Methods and Internal Slots

summarizes the essential internal methods used by this specification that are applicable to all objects created or manipulated by ECMAScript code. Every object must have algorithms for all of the essential internal methods. However, all objects do not necessarily use the same algorithms for those methods.

The “Signature” column of and other similar tables describes the invocation pattern for each internal method. The invocation pattern always includes a parenthesized list of descriptive parameter names. If a parameter name is the same as an ECMAScript type name then the name describes the required type of the parameter value. If an internal method explicitly returns a value, its parameter list is followed by the symbol “→” and the type name of the returned value. The type names used in signatures refer to the types defined in clause augmented by the following additional names. “any” means the value may be any ECMAScript language type.

In addition to its parameters, an internal method always has access to the object that is the target of the method invocation.

-

An internal method implicitly returns a Completion Record.

+

An internal method implicitly returns a Completion Record, either a normal completion that wraps a value of the return type shown in its invocation pattern, or a throw completion.

@@ -1555,10 +1555,19 @@

Definitions:

All references to SameValue are according to the definition of the SameValue algorithm. +

Return value:

+

The value returned by any internal method must be a Completion Record with either:

+ + +

An internal method must not return a completion with [[Type]] = ~continue~, ~break~, or ~return~.

+

[[GetPrototypeOf]] ( )