From 4bb59ee35092a37c0cff3fce5619da3cb733a775 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 19 Aug 2022 11:51:40 -0700 Subject: [PATCH] Editorial: IfAbrupt macros only take completion records (#2817) --- spec.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/spec.html b/spec.html index 56df9e8b48..8e72a15afc 100644 --- a/spec.html +++ b/spec.html @@ -895,8 +895,9 @@

ReturnIfAbrupt

mean the same thing as:

+ 1. Assert: _argument_ is a Completion Record. 1. If _argument_ is an abrupt completion, return Completion(_argument_). - 1. Else if _argument_ is a Completion Record, set _argument_ to _argument_.[[Value]]. + 1. Else, set _argument_ to _argument_.[[Value]].

Algorithms steps that say or are otherwise equivalent to:

@@ -905,8 +906,9 @@

ReturnIfAbrupt

mean the same thing as:

1. Let _hygienicTemp_ be AbstractOperation(). + 1. Assert: _hygienicTemp_ is a Completion Record. 1. If _hygienicTemp_ is an abrupt completion, return Completion(_hygienicTemp_). - 1. Else if _hygienicTemp_ is a Completion Record, set _hygienicTemp_ to _hygienicTemp_.[[Value]]. + 1. Else, set _hygienicTemp_ to _hygienicTemp_.[[Value]].

Where _hygienicTemp_ is ephemeral and visible only in the steps pertaining to ReturnIfAbrupt.

Algorithms steps that say or are otherwise equivalent to:

@@ -915,8 +917,9 @@

ReturnIfAbrupt

mean the same thing as:

+ 1. Assert: _argument_ is a Completion Record. 1. If _argument_ is an abrupt completion, return Completion(_argument_). - 1. If _argument_ is a Completion Record, set _argument_ to _argument_.[[Value]]. + 1. Else, set _argument_ to _argument_.[[Value]]. 1. Let _result_ be AbstractOperation(_argument_). @@ -946,8 +949,8 @@

ReturnIfAbrupt Shorthands

is equivalent to the following steps:

1. Let _val_ be OperationName(). - 1. Assert: _val_ is never an abrupt completion. - 1. If _val_ is a Completion Record, set _val_ to _val_.[[Value]]. + 1. Assert: _val_ is a normal completion. + 1. Set _val_ to _val_.[[Value]].

Syntax-directed operations for runtime semantics make use of this shorthand by placing `!` or `?` before the invocation of the operation:

@@ -7153,8 +7156,9 @@

IfAbruptCloseIterator ( _value_, _iteratorRecord_ )

means the same thing as:

+ 1. Assert: _value_ is a Completion Record. 1. If _value_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _value_). - 1. Else if _value_ is a Completion Record, set _value_ to _value_.[[Value]]. + 1. Else, set _value_ to _value_.[[Value]]. @@ -43696,10 +43700,11 @@

IfAbruptRejectPromise ( _value_, _capability_ )

means the same thing as:

+ 1. Assert: _value_ is a Completion Record. 1. If _value_ is an abrupt completion, then 1. Perform ? Call(_capability_.[[Reject]], *undefined*, « _value_.[[Value]] »). 1. Return _capability_.[[Promise]]. - 1. Else if _value_ is a Completion Record, set _value_ to _value_.[[Value]]. + 1. Else, set _value_ to _value_.[[Value]].