diff --git a/src/computed-property-names/computed-property-name-from-null.case b/src/computed-property-names/computed-property-name-from-null.case new file mode 100644 index 0000000000..e44a4ad592 --- /dev/null +++ b/src/computed-property-names/computed-property-name-from-null.case @@ -0,0 +1,12 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Computed property name from condition expression +template: evaluation +features: [computed-property-names] +---*/ +//- ComputedPropertyName +null +//- value +null diff --git a/src/computed-property-names/evaluation/class-declaration-accessors.template b/src/computed-property-names/evaluation/class-declaration-accessors.template index bc110896a2..5dd84afd49 100644 --- a/src/computed-property-names/evaluation/class-declaration-accessors.template +++ b/src/computed-property-names/evaluation/class-declaration-accessors.template @@ -70,3 +70,20 @@ assert.sameValue( C[/*{ComputedPropertyName}*/] = /*{value}*/, /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)] = /*{value}*/, + /*{value}*/ +); + +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)] = /*{value}*/, + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-declaration-fields-methods.template b/src/computed-property-names/evaluation/class-declaration-fields-methods.template index 2cb989046a..d35623df09 100644 --- a/src/computed-property-names/evaluation/class-declaration-fields-methods.template +++ b/src/computed-property-names/evaluation/class-declaration-fields-methods.template @@ -53,3 +53,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/](), /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-declaration-fields.template b/src/computed-property-names/evaluation/class-declaration-fields.template index e2faf870a9..a49ee7a410 100644 --- a/src/computed-property-names/evaluation/class-declaration-fields.template +++ b/src/computed-property-names/evaluation/class-declaration-fields.template @@ -49,3 +49,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/], /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-declaration.template b/src/computed-property-names/evaluation/class-declaration.template index 8c55cf4254..ce462de2be 100644 --- a/src/computed-property-names/evaluation/class-declaration.template +++ b/src/computed-property-names/evaluation/class-declaration.template @@ -52,3 +52,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/](), /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-expression-accessors.template b/src/computed-property-names/evaluation/class-expression-accessors.template index 8c6e9fbb13..8be751ce2c 100644 --- a/src/computed-property-names/evaluation/class-expression-accessors.template +++ b/src/computed-property-names/evaluation/class-expression-accessors.template @@ -70,3 +70,20 @@ assert.sameValue( C[/*{ComputedPropertyName}*/] = /*{value}*/, /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)] = /*{value}*/, + /*{value}*/ +); + +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)] = /*{value}*/, + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-expression-fields-methods.template b/src/computed-property-names/evaluation/class-expression-fields-methods.template index 7ab950e4d4..ba1ea45e50 100644 --- a/src/computed-property-names/evaluation/class-expression-fields-methods.template +++ b/src/computed-property-names/evaluation/class-expression-fields-methods.template @@ -53,3 +53,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/](), /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-expression-fields.template b/src/computed-property-names/evaluation/class-expression-fields.template index a92b3d6391..0c845b7507 100644 --- a/src/computed-property-names/evaluation/class-expression-fields.template +++ b/src/computed-property-names/evaluation/class-expression-fields.template @@ -49,3 +49,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/], /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/class-expression.template b/src/computed-property-names/evaluation/class-expression.template index d658277e4f..f67ec89b78 100644 --- a/src/computed-property-names/evaluation/class-expression.template +++ b/src/computed-property-names/evaluation/class-expression.template @@ -52,3 +52,11 @@ assert.sameValue( C[/*{ComputedPropertyName}*/](), /*{value}*/ ); +assert.sameValue( + c[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); +assert.sameValue( + C[String(/*{ComputedPropertyName}*/)](), + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/object-literal.template b/src/computed-property-names/evaluation/object-literal.template index ba8ce02a2d..633e8c86aa 100644 --- a/src/computed-property-names/evaluation/object-literal.template +++ b/src/computed-property-names/evaluation/object-literal.template @@ -30,3 +30,7 @@ assert.sameValue( o[/*{ComputedPropertyName}*/], /*{value}*/ ); +assert.sameValue( + o[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +); diff --git a/src/computed-property-names/evaluation/yield-expression.template b/src/computed-property-names/evaluation/yield-expression.template index 0830180d1d..6aa249a634 100644 --- a/src/computed-property-names/evaluation/yield-expression.template +++ b/src/computed-property-names/evaluation/yield-expression.template @@ -30,3 +30,7 @@ assert.sameValue( o[/*{ComputedPropertyName}*/], /*{value}*/ ); +assert.sameValue( + o[String(/*{ComputedPropertyName}*/)], + /*{value}*/ +);