From aab4c0785eb81091656a20a7caaaa4bb0cf70f05 Mon Sep 17 00:00:00 2001 From: Caio Lima Date: Fri, 9 Apr 2021 09:47:44 -0300 Subject: [PATCH] Adding missing optional chain + private identifiers support --- spec.html | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 320691b0c34..4059ae764e4 100644 --- a/spec.html +++ b/spec.html @@ -5859,7 +5859,7 @@

PrivateFieldSet ( _P_, _O_, _value_ )

1. Perform ? PrivateBrandCheck(_O_, _P_). 1. If _P_ does not have a [[Set]] field, throw a *TypeError* exception. 1. Let _setter_ be _P_.[[Set]]. - 1. Perform ? Call(_setter_, _O_, « _value_ &rqauo;). + 1. Perform ? Call(_setter_, _O_, « _value_ »). @@ -16071,10 +16071,12 @@

Syntax

`?.` `[` Expression[+In, ?Yield, ?Await] `]` `?.` IdentifierName `?.` TemplateLiteral[?Yield, ?Await, +Tagged] + `?.` PrivateIdentifier OptionalChain[?Yield, ?Await] Arguments[?Yield, ?Await] OptionalChain[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` OptionalChain[?Yield, ?Await] `.` IdentifierName OptionalChain[?Yield, ?Await] TemplateLiteral[?Yield, ?Await, +Tagged] + OptionalChain[?Yield, ?Await] `.` PrivateIdentifier LeftHandSideExpression[Yield, Await] : NewExpression[?Yield, ?Await] @@ -16528,6 +16530,12 @@

Runtime Semantics: ChainEvaluation

1. If the code matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*. 1. Return ? EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_). + OptionalChain : `?.` PrivateIdentifier + + 1. Let _bv_ be ? RequireObjectCoercible(_baseValue_). + 1. Let _fieldNameString_ be the StringValue of |PrivateIdentifier|. + 1. Return MakePrivateReference(_bv_, _fieldNameString_). + OptionalChain : OptionalChain Arguments 1. Let _optionalChain_ be |OptionalChain|. @@ -16553,6 +16561,15 @@

Runtime Semantics: ChainEvaluation

1. If the code matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*. 1. Return ? EvaluatePropertyAccessWithIdentifierKey(_newValue_, |IdentifierName|, _strict_).
+ OptionalChain : OptionalChain `.` PrivateIdentifier + + 1. Let _optionalChain_ be |OptionalChain|. + 1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_. + 1. Let _newValue_ be ? GetValue(_newReference_). + 1. Let _nv_ be ? RequireObjectCoercible(_newValue_). + 1. Let _fieldNameString_ be the StringValue of |PrivateIdentifier|. + 1. Return MakePrivateReference(_nv_, _fieldNameString_). + @@ -16789,7 +16806,7 @@

Static Semantics: Early Errors

UnaryExpression : `delete` UnaryExpression