From 5e33f80bf375612e2be756656abb805670f2f8fd Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Fri, 29 May 2020 11:14:43 -0700 Subject: [PATCH 1/2] Editorial: Remove unused steps from definitions of Contains (#1519) ... specifically, steps of the form: If _symbol_ is an |Identifier| and StringValue of _symbol_ is the same value as the StringValue of |IdentifierName|, return *true*. Resolves issue #831. As @allenwb points out, the intended use case for such steps does not occur in the spec. And as I point out, these steps are semantically problematic. If the intended use case ever *does* occur, I'm guessing we'll find a different way to handle it. --- spec.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec.html b/spec.html index 8c7ab09651..b78b7084a6 100644 --- a/spec.html +++ b/spec.html @@ -12793,7 +12793,6 @@

Static Semantics: Contains

LiteralPropertyName : IdentifierName 1. If _symbol_ is a |ReservedWord|, return *false*. - 1. If _symbol_ is an |Identifier| and StringValue of _symbol_ is the same value as the StringValue of |IdentifierName|, return *true*. 1. Return *false*. @@ -13473,21 +13472,18 @@

Static Semantics: Contains

1. If |MemberExpression| Contains _symbol_ is *true*, return *true*. 1. If _symbol_ is a |ReservedWord|, return *false*. - 1. If _symbol_ is an |Identifier| and StringValue of _symbol_ is the same value as the StringValue of |IdentifierName|, return *true*. 1. Return *false*. SuperProperty : `super` `.` IdentifierName 1. If _symbol_ is the |ReservedWord| `super`, return *true*. 1. If _symbol_ is a |ReservedWord|, return *false*. - 1. If _symbol_ is an |Identifier| and StringValue of _symbol_ is the same value as the StringValue of |IdentifierName|, return *true*. 1. Return *false*. CallExpression : CallExpression `.` IdentifierName 1. If |CallExpression| Contains _symbol_ is *true*, return *true*. 1. If _symbol_ is a |ReservedWord|, return *false*. - 1. If _symbol_ is an |Identifier| and StringValue of _symbol_ is the same value as the StringValue of |IdentifierName|, return *true*. 1. Return *false*. OptionalChain : `?.` IdentifierName From 9e48030ca8c696a7137fdd533fc4bf4db16b7685 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Fri, 29 May 2020 11:15:06 -0700 Subject: [PATCH 2/2] Editorial: simplify definitions of Contains (#1519) ... after previous commit. Specifically, when code says: ``` 1. If , return *false*. 1. Return *false*. ``` we can drop the first step, because the result is `*false*` either way. --- spec.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/spec.html b/spec.html index b78b7084a6..4c853e36fc 100644 --- a/spec.html +++ b/spec.html @@ -12792,7 +12792,6 @@

Static Semantics: Contains

LiteralPropertyName : IdentifierName - 1. If _symbol_ is a |ReservedWord|, return *false*. 1. Return *false*. @@ -13471,19 +13470,16 @@

Static Semantics: Contains

MemberExpression : MemberExpression `.` IdentifierName 1. If |MemberExpression| Contains _symbol_ is *true*, return *true*. - 1. If _symbol_ is a |ReservedWord|, return *false*. 1. Return *false*. SuperProperty : `super` `.` IdentifierName 1. If _symbol_ is the |ReservedWord| `super`, return *true*. - 1. If _symbol_ is a |ReservedWord|, return *false*. 1. Return *false*. CallExpression : CallExpression `.` IdentifierName 1. If |CallExpression| Contains _symbol_ is *true*, return *true*. - 1. If _symbol_ is a |ReservedWord|, return *false*. 1. Return *false*. OptionalChain : `?.` IdentifierName