From ccc47d82c78eb02c5a63baac3922278ca9dbeb34 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Thu, 15 Jun 2017 08:43:18 +0200 Subject: [PATCH 1/2] Editorial: Use grammardown and Await parameter consistently --- Spec.html | 60 ++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/Spec.html b/Spec.html index da35e94..5c7b4ce 100644 --- a/Spec.html +++ b/Spec.html @@ -33,15 +33,13 @@

Spread Properties

Syntax

- - IdentifierReference - CoverInitializedName - PropertyName:AssignmentExpression - MethodDefinition - - ...AssignmentExpression - - + + PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] + `...` AssignmentExpression[In, ?Yield, ?Await] +

Runtime Semantics: PropertyDefinitionEvaluation

@@ -66,30 +64,28 @@

Rest Properties

Syntax

- - {AssignmentRestProperty} - {AssignmentPropertyList} - {AssignmentPropertyList,AssignmentRestProperty} - + + ObjectAssignmentPattern[Yield, Await] : + `{` AssignmentRestProperty[?Yield, ?Await]? `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` AssignmentRestProperty[?Yield, ?Await]? `}` - - - ...DestructuringAssignmentTarget - - + + AssignmentRestProperty[Yield, Await] : + `...` DestructuringAssignmentTarget[Yield, Await] + - - {BindingRestProperty} - {BindingPropertyList} - {BindingPropertyList,BindingRestProperty} - + ObjectBindingPattern[Yield, Await] : + `{` BindingRestProperty[?Yield, ?Await]? `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` BindingRestProperty[?Yield, ?Await]? `}` - - - ...BindingIdentifier - ...BindingPattern - - + + BindingRestProperty[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] + +

Runtime Semantics: DestructuringAssignmentEvaluation

@@ -177,7 +173,7 @@

Runtime Semantics: PropertyDestructuringAssignmentEvaluation

Runtime Semantics: RestDestructuringAssignmentEvaluation

With parameters _value_ and _excludedNames_.

- AssignmentRestProperty[Yield] : `...` DestructuringAssignmentTarget + AssignmentRestProperty[Yield, Await] : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be the result of evaluating |DestructuringAssignmentTarget|. @@ -187,7 +183,7 @@

Runtime Semantics: RestDestructuringAssignmentEvaluation

1. ReturnIfAbrupt(_assignStatus_). 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Return PutValue(_lref_, _restObj_). - 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using either |AssignmentPattern| or |AssignmentPattern[Yield]| as the goal symbol depending upon whether this |AssignmentRestProperty| has the [Yield] parameter. + 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using either |AssignmentPattern[?Yield, ?Await]| as the goal symbol, adopting the parameter values from |AssignmentRestProperty|. 1. Return the result of performing DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with _restObj_ as the argument.
From f152f9cea8c4fcaa7c868a5fcfa63df30bdd26e0 Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Thu, 15 Jun 2017 09:02:32 +0200 Subject: [PATCH 2/2] Normative: Disallow binding patterns of arrays or objects This was the consensus recorded in the minutes for the May 2017 TC39 meeting, following bug https://github.com/tc39/proposal-object-rest-spread/issues/43 --- Spec.html | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Spec.html b/Spec.html index 5c7b4ce..86652d4 100644 --- a/Spec.html +++ b/Spec.html @@ -83,7 +83,6 @@

Syntax

BindingRestProperty[Yield, Await] : `...` BindingIdentifier[?Yield, ?Await] - `...` BindingPattern[?Yield, ?Await] @@ -280,14 +279,6 @@

Runtime Semantics: RestBindingInitialization

1. If _environment_ is *undefined*, return PutValue(_lhs_, _restObj_). 1. Return InitializeReferencedBinding(_lhs_, _restObj_). - - BindingRestProperty : `...` BindingPattern - - 1. Let _restObj_ be ObjectCreate(%ObjectPrototype%). - 1. Let _assignStatus_ be CopyDataProperties(_restObj_, _value_, _excludedNames_). - 1. ReturnIfAbrupt(_assignStatus_). - 1. Return the result of performing BindingInitialization of |BindingPattern| with _restObj_ and _environment_ as the arguments. -