Coverage: computed property names that evaluate to null. Fixes gh-1734

This commit is contained in:
Rick Waldron 2020-09-25 13:12:23 -04:00
parent 1fd417b146
commit 4375480990
11 changed files with 102 additions and 0 deletions

View File

@ -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

View File

@ -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}*/
);

View File

@ -53,3 +53,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/](),
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);

View File

@ -49,3 +49,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/],
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);

View File

@ -52,3 +52,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/](),
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);

View File

@ -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}*/
);

View File

@ -53,3 +53,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/](),
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);

View File

@ -49,3 +49,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/],
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);

View File

@ -52,3 +52,11 @@ assert.sameValue(
C[/*{ComputedPropertyName}*/](),
/*{value}*/
);
assert.sameValue(
c[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);
assert.sameValue(
C[String(/*{ComputedPropertyName}*/)](),
/*{value}*/
);

View File

@ -30,3 +30,7 @@ assert.sameValue(
o[/*{ComputedPropertyName}*/],
/*{value}*/
);
assert.sameValue(
o[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);

View File

@ -30,3 +30,7 @@ assert.sameValue(
o[/*{ComputedPropertyName}*/],
/*{value}*/
);
assert.sameValue(
o[String(/*{ComputedPropertyName}*/)],
/*{value}*/
);