Generate tests

This commit is contained in:
Rick Waldron 2020-09-25 13:12:40 -04:00
parent 4375480990
commit cd778bea8c
300 changed files with 3248 additions and 0 deletions

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1 + 1] = 2,
2
);
assert.sameValue(
c[String(1 + 1)],
2
);
assert.sameValue(
c[String(1 + 1)] = 2,
2
);
assert.sameValue(
C[String(1 + 1)],
2
);
assert.sameValue(
C[String(1 + 1)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1 - 1] = 0,
0
);
assert.sameValue(
c[String(1 - 1)],
0
);
assert.sameValue(
c[String(1 - 1)] = 0,
0
);
assert.sameValue(
C[String(1 - 1)],
0
);
assert.sameValue(
C[String(1 - 1)] = 0,
0
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[() => { }] = 1,
1
);
assert.sameValue(
c[String(() => { })],
1
);
assert.sameValue(
c[String(() => { })] = 1,
1
);
assert.sameValue(
C[String(() => { })],
1
);
assert.sameValue(
C[String(() => { })] = 1,
1
);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x = 1] = 2,
2
);
assert.sameValue(
c[String(x = 1)],
2
);
assert.sameValue(
c[String(x = 1)] = 2,
2
);
assert.sameValue(
C[String(x = 1)],
2
);
assert.sameValue(
C[String(x = 1)] = 2,
2
);
assert.sameValue(x, 1);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x |= 1] = 2,
2
);
assert.sameValue(
c[String(x |= 1)],
2
);
assert.sameValue(
c[String(x |= 1)] = 2,
2
);
assert.sameValue(
C[String(x |= 1)],
2
);
assert.sameValue(
C[String(x |= 1)] = 2,
2
);
assert.sameValue(x, 1);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x ??= 1] = 2,
2
);
assert.sameValue(
c[String(x ??= 1)],
2
);
assert.sameValue(
c[String(x ??= 1)] = 2,
2
);
assert.sameValue(
C[String(x ??= 1)],
2
);
assert.sameValue(
C[String(x ??= 1)] = 2,
2
);
assert.sameValue(x, 1);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x &&= 1] = 2,
2
);
assert.sameValue(
c[String(x &&= 1)],
2
);
assert.sameValue(
c[String(x &&= 1)] = 2,
2
);
assert.sameValue(
C[String(x &&= 1)],
2
);
assert.sameValue(
C[String(x &&= 1)] = 2,
2
);
assert.sameValue(x, 0);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x ||= 1] = 2,
2
);
assert.sameValue(
c[String(x ||= 1)],
2
);
assert.sameValue(
c[String(x ||= 1)] = 2,
2
);
assert.sameValue(
C[String(x ||= 1)],
2
);
assert.sameValue(
C[String(x ||= 1)] = 2,
2
);
assert.sameValue(x, 1);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[async () => {}] = 1,
1
);
assert.sameValue(
c[String(async () => {})],
1
);
assert.sameValue(
c[String(async () => {})] = 1,
1
);
assert.sameValue(
C[String(async () => {})],
1
);
assert.sameValue(
C[String(async () => {})] = 1,
1
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[false ? 1 : 2] = 1,
1
);
assert.sameValue(
c[String(false ? 1 : 2)],
1
);
assert.sameValue(
c[String(false ? 1 : 2)] = 1,
1
);
assert.sameValue(
C[String(false ? 1 : 2)],
1
);
assert.sameValue(
C[String(false ? 1 : 2)] = 1,
1
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[true ? 1 : 2] = 2,
2
);
assert.sameValue(
c[String(true ? 1 : 2)],
2
);
assert.sameValue(
c[String(true ? 1 : 2)] = 2,
2
);
assert.sameValue(
C[String(true ? 1 : 2)],
2
);
assert.sameValue(
C[String(true ? 1 : 2)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1.e1] = 2,
2
);
assert.sameValue(
c[String(1.e1)],
2
);
assert.sameValue(
c[String(1.e1)] = 2,
2
);
assert.sameValue(
C[String(1.e1)],
2
);
assert.sameValue(
C[String(1.e1)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1.1] = 2,
2
);
assert.sameValue(
c[String(1.1)],
2
);
assert.sameValue(
c[String(1.1)] = 2,
2
);
assert.sameValue(
C[String(1.1)],
2
);
assert.sameValue(
C[String(1.1)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[2 ** 2] = 4,
4
);
assert.sameValue(
c[String(2 ** 2)],
4
);
assert.sameValue(
c[String(2 ** 2)] = 4,
4
);
assert.sameValue(
C[String(2 ** 2)],
4
);
assert.sameValue(
C[String(2 ** 2)] = 4,
4
);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x ?? 1] = 2,
2
);
assert.sameValue(
c[String(x ?? 1)],
2
);
assert.sameValue(
c[String(x ?? 1)] = 2,
2
);
assert.sameValue(
C[String(x ?? 1)],
2
);
assert.sameValue(
C[String(x ?? 1)] = 2,
2
);
assert.sameValue(x, undefined);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x && 1] = 2,
2
);
assert.sameValue(
c[String(x && 1)],
2
);
assert.sameValue(
c[String(x && 1)] = 2,
2
);
assert.sameValue(
C[String(x && 1)],
2
);
assert.sameValue(
C[String(x && 1)] = 2,
2
);
assert.sameValue(x, 0);

View File

@ -73,5 +73,22 @@ assert.sameValue(
C[x || 1] = 2,
2
);
assert.sameValue(
c[String(x || 1)],
2
);
assert.sameValue(
c[String(x || 1)] = 2,
2
);
assert.sameValue(
C[String(x || 1)],
2
);
assert.sameValue(
C[String(x || 1)] = 2,
2
);
assert.sameValue(x, 0);

View File

@ -73,3 +73,20 @@ assert.sameValue(
C[f()] = 1,
1
);
assert.sameValue(
c[String(f())],
1
);
assert.sameValue(
c[String(f())] = 1,
1
);
assert.sameValue(
C[String(f())],
1
);
assert.sameValue(
C[String(f())] = 1,
1
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[function () {}] = 1,
1
);
assert.sameValue(
c[String(function () {})],
1
);
assert.sameValue(
c[String(function () {})] = 1,
1
);
assert.sameValue(
C[String(function () {})],
1
);
assert.sameValue(
C[String(function () {})] = 1,
1
);

View File

@ -73,3 +73,20 @@ assert.sameValue(
C[g()] = 1,
1
);
assert.sameValue(
c[String(g())],
1
);
assert.sameValue(
c[String(g())] = 1,
1
);
assert.sameValue(
C[String(g())],
1
);
assert.sameValue(
C[String(g())] = 1,
1
);

View File

@ -74,3 +74,20 @@ assert.sameValue(
C[x] = '2',
'2'
);
assert.sameValue(
c[String(x)],
'2'
);
assert.sameValue(
c[String(x)] = '2',
'2'
);
assert.sameValue(
C[String(x)],
'2'
);
assert.sameValue(
C[String(x)] = '2',
'2'
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1] = 2,
2
);
assert.sameValue(
c[String(1)],
2
);
assert.sameValue(
c[String(1)] = 2,
2
);
assert.sameValue(
C[String(1)],
2
);
assert.sameValue(
C[String(1)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1_2_3_4_5_6_7_8] = 1_2_3_4_5_6_7_8,
1_2_3_4_5_6_7_8
);
assert.sameValue(
c[String(1_2_3_4_5_6_7_8)],
1_2_3_4_5_6_7_8
);
assert.sameValue(
c[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8,
1_2_3_4_5_6_7_8
);
assert.sameValue(
C[String(1_2_3_4_5_6_7_8)],
1_2_3_4_5_6_7_8
);
assert.sameValue(
C[String(1_2_3_4_5_6_7_8)] = 1_2_3_4_5_6_7_8,
1_2_3_4_5_6_7_8
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1 + 2 - 3 * 4 / 5 ** 6] = 2.999232,
2.999232
);
assert.sameValue(
c[String(1 + 2 - 3 * 4 / 5 ** 6)],
2.999232
);
assert.sameValue(
c[String(1 + 2 - 3 * 4 / 5 ** 6)] = 2.999232,
2.999232
);
assert.sameValue(
C[String(1 + 2 - 3 * 4 / 5 ** 6)],
2.999232
);
assert.sameValue(
C[String(1 + 2 - 3 * 4 / 5 ** 6)] = 2.999232,
2.999232
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1 / 1] = 1,
1
);
assert.sameValue(
c[String(1 / 1)],
1
);
assert.sameValue(
c[String(1 / 1)] = 1,
1
);
assert.sameValue(
C[String(1 / 1)],
1
);
assert.sameValue(
C[String(1 / 1)] = 1,
1
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1 * 1] = 1,
1
);
assert.sameValue(
c[String(1 * 1)],
1
);
assert.sameValue(
c[String(1 * 1)] = 1,
1
);
assert.sameValue(
C[String(1 * 1)],
1
);
assert.sameValue(
C[String(1 * 1)] = 1,
1
);

View File

@ -0,0 +1,91 @@
// This file was procedurally generated from the following sources:
// - src/computed-property-names/computed-property-name-from-null.case
// - src/computed-property-names/evaluation/class-expression-accessors.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names]
flags: [generated]
info: |
ClassExpression:
classBindingIdentifier opt ClassTail
ClassTail:
ClassHeritage opt { ClassBody opt }
ClassBody:
ClassElementList
ClassElementList:
ClassElement
ClassElement:
MethodDefinition
MethodDefinition:
PropertyName ...
get PropertyName ...
set PropertyName ...
PropertyName:
ComputedPropertyName
ComputedPropertyName:
[ AssignmentExpression ]
---*/
let C = class {
get [null]() {
return null;
}
set [null](v) {
return null;
}
static get [null]() {
return null;
}
static set [null](v) {
return null;
}
};
let c = new C();
assert.sameValue(
c[null],
null
);
assert.sameValue(
c[null] = null,
null
);
assert.sameValue(
C[null],
null
);
assert.sameValue(
C[null] = null,
null
);
assert.sameValue(
c[String(null)],
null
);
assert.sameValue(
c[String(null)] = null,
null
);
assert.sameValue(
C[String(null)],
null
);
assert.sameValue(
C[String(null)] = null,
null
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[1] = 2,
2
);
assert.sameValue(
c[String(1)],
2
);
assert.sameValue(
c[String(1)] = 2,
2
);
assert.sameValue(
C[String(1)],
2
);
assert.sameValue(
C[String(1)] = 2,
2
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C['1'] = '2',
'2'
);
assert.sameValue(
c[String('1')],
'2'
);
assert.sameValue(
c[String('1')] = '2',
'2'
);
assert.sameValue(
C[String('1')],
'2'
);
assert.sameValue(
C[String('1')] = '2',
'2'
);

View File

@ -72,3 +72,20 @@ assert.sameValue(
C[true ? 1 : 2] = 2,
2
);
assert.sameValue(
c[String(true ? 1 : 2)],
2
);
assert.sameValue(
c[String(true ? 1 : 2)] = 2,
2
);
assert.sameValue(
C[String(true ? 1 : 2)],
2
);
assert.sameValue(
C[String(true ? 1 : 2)] = 2,
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1 + 1](),
2
);
assert.sameValue(
c[String(1 + 1)](),
2
);
assert.sameValue(
C[String(1 + 1)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1 - 1](),
0
);
assert.sameValue(
c[String(1 - 1)](),
0
);
assert.sameValue(
C[String(1 - 1)](),
0
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[() => { }](),
1
);
assert.sameValue(
c[String(() => { })](),
1
);
assert.sameValue(
C[String(() => { })](),
1
);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x = 1](),
2
);
assert.sameValue(
c[String(x = 1)](),
2
);
assert.sameValue(
C[String(x = 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x |= 1](),
2
);
assert.sameValue(
c[String(x |= 1)](),
2
);
assert.sameValue(
C[String(x |= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x ??= 1](),
2
);
assert.sameValue(
c[String(x ??= 1)](),
2
);
assert.sameValue(
C[String(x ??= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x &&= 1](),
2
);
assert.sameValue(
c[String(x &&= 1)](),
2
);
assert.sameValue(
C[String(x &&= 1)](),
2
);
assert.sameValue(x, 0);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x ||= 1](),
2
);
assert.sameValue(
c[String(x ||= 1)](),
2
);
assert.sameValue(
C[String(x ||= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[async () => {}](),
1
);
assert.sameValue(
c[String(async () => {})](),
1
);
assert.sameValue(
C[String(async () => {})](),
1
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[false ? 1 : 2](),
1
);
assert.sameValue(
c[String(false ? 1 : 2)](),
1
);
assert.sameValue(
C[String(false ? 1 : 2)](),
1
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[true ? 1 : 2](),
2
);
assert.sameValue(
c[String(true ? 1 : 2)](),
2
);
assert.sameValue(
C[String(true ? 1 : 2)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1.e1](),
2
);
assert.sameValue(
c[String(1.e1)](),
2
);
assert.sameValue(
C[String(1.e1)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1.1](),
2
);
assert.sameValue(
c[String(1.1)](),
2
);
assert.sameValue(
C[String(1.1)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[2 ** 2](),
4
);
assert.sameValue(
c[String(2 ** 2)](),
4
);
assert.sameValue(
C[String(2 ** 2)](),
4
);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x ?? 1](),
2
);
assert.sameValue(
c[String(x ?? 1)](),
2
);
assert.sameValue(
C[String(x ?? 1)](),
2
);
assert.sameValue(x, undefined);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x && 1](),
2
);
assert.sameValue(
c[String(x && 1)](),
2
);
assert.sameValue(
C[String(x && 1)](),
2
);
assert.sameValue(x, 0);

View File

@ -55,5 +55,13 @@ assert.sameValue(
C[x || 1](),
2
);
assert.sameValue(
c[String(x || 1)](),
2
);
assert.sameValue(
C[String(x || 1)](),
2
);
assert.sameValue(x, 0);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[f()](),
1
);
assert.sameValue(
c[String(f())](),
1
);
assert.sameValue(
C[String(f())](),
1
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[function () {}](),
1
);
assert.sameValue(
c[String(function () {})](),
1
);
assert.sameValue(
C[String(function () {})](),
1
);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[g()](),
1
);
assert.sameValue(
c[String(g())](),
1
);
assert.sameValue(
C[String(g())](),
1
);

View File

@ -56,3 +56,11 @@ assert.sameValue(
C[x](),
'2'
);
assert.sameValue(
c[String(x)](),
'2'
);
assert.sameValue(
C[String(x)](),
'2'
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1](),
2
);
assert.sameValue(
c[String(1)](),
2
);
assert.sameValue(
C[String(1)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1_2_3_4_5_6_7_8](),
1_2_3_4_5_6_7_8
);
assert.sameValue(
c[String(1_2_3_4_5_6_7_8)](),
1_2_3_4_5_6_7_8
);
assert.sameValue(
C[String(1_2_3_4_5_6_7_8)](),
1_2_3_4_5_6_7_8
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1 + 2 - 3 * 4 / 5 ** 6](),
2.999232
);
assert.sameValue(
c[String(1 + 2 - 3 * 4 / 5 ** 6)](),
2.999232
);
assert.sameValue(
C[String(1 + 2 - 3 * 4 / 5 ** 6)](),
2.999232
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1 / 1](),
1
);
assert.sameValue(
c[String(1 / 1)](),
1
);
assert.sameValue(
C[String(1 / 1)](),
1
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1 * 1](),
1
);
assert.sameValue(
c[String(1 * 1)](),
1
);
assert.sameValue(
C[String(1 * 1)](),
1
);

View File

@ -0,0 +1,64 @@
// This file was procedurally generated from the following sources:
// - src/computed-property-names/computed-property-name-from-null.case
// - src/computed-property-names/evaluation/class-expression.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names]
flags: [generated]
info: |
ClassExpression:
classBindingIdentifier opt ClassTail
ClassTail:
ClassHeritage opt { ClassBody opt }
ClassBody:
ClassElementList
ClassElementList:
ClassElement
ClassElement:
MethodDefinition
MethodDefinition:
PropertyName ...
get PropertyName ...
set PropertyName ...
PropertyName:
ComputedPropertyName
ComputedPropertyName:
[ AssignmentExpression ]
---*/
let C = class {
[null]() {
return null;
}
static [null]() {
return null;
}
};
let c = new C();
assert.sameValue(
c[null](),
null
);
assert.sameValue(
C[null](),
null
);
assert.sameValue(
c[String(null)](),
null
);
assert.sameValue(
C[String(null)](),
null
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[1](),
2
);
assert.sameValue(
c[String(1)](),
2
);
assert.sameValue(
C[String(1)](),
2
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C['1'](),
'2'
);
assert.sameValue(
c[String('1')](),
'2'
);
assert.sameValue(
C[String('1')](),
'2'
);

View File

@ -54,3 +54,11 @@ assert.sameValue(
C[true ? 1 : 2](),
2
);
assert.sameValue(
c[String(true ? 1 : 2)](),
2
);
assert.sameValue(
C[String(true ? 1 : 2)](),
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1 + 1],
2
);
assert.sameValue(
c[String(1 + 1)],
2
);
assert.sameValue(
C[String(1 + 1)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1 - 1],
0
);
assert.sameValue(
c[String(1 - 1)],
0
);
assert.sameValue(
C[String(1 - 1)],
0
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[() => { }],
1
);
assert.sameValue(
c[String(() => { })],
1
);
assert.sameValue(
C[String(() => { })],
1
);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x = 1],
2
);
assert.sameValue(
c[String(x = 1)],
2
);
assert.sameValue(
C[String(x = 1)],
2
);
assert.sameValue(x, 1);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x |= 1],
2
);
assert.sameValue(
c[String(x |= 1)],
2
);
assert.sameValue(
C[String(x |= 1)],
2
);
assert.sameValue(x, 1);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x ??= 1],
2
);
assert.sameValue(
c[String(x ??= 1)],
2
);
assert.sameValue(
C[String(x ??= 1)],
2
);
assert.sameValue(x, 1);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x &&= 1],
2
);
assert.sameValue(
c[String(x &&= 1)],
2
);
assert.sameValue(
C[String(x &&= 1)],
2
);
assert.sameValue(x, 0);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x ||= 1],
2
);
assert.sameValue(
c[String(x ||= 1)],
2
);
assert.sameValue(
C[String(x ||= 1)],
2
);
assert.sameValue(x, 1);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[async () => {}],
1
);
assert.sameValue(
c[String(async () => {})],
1
);
assert.sameValue(
C[String(async () => {})],
1
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[false ? 1 : 2],
1
);
assert.sameValue(
c[String(false ? 1 : 2)],
1
);
assert.sameValue(
C[String(false ? 1 : 2)],
1
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[true ? 1 : 2],
2
);
assert.sameValue(
c[String(true ? 1 : 2)],
2
);
assert.sameValue(
C[String(true ? 1 : 2)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1.e1],
2
);
assert.sameValue(
c[String(1.e1)],
2
);
assert.sameValue(
C[String(1.e1)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1.1],
2
);
assert.sameValue(
c[String(1.1)],
2
);
assert.sameValue(
C[String(1.1)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[2 ** 2],
4
);
assert.sameValue(
c[String(2 ** 2)],
4
);
assert.sameValue(
C[String(2 ** 2)],
4
);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x ?? 1],
2
);
assert.sameValue(
c[String(x ?? 1)],
2
);
assert.sameValue(
C[String(x ?? 1)],
2
);
assert.sameValue(x, undefined);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x && 1],
2
);
assert.sameValue(
c[String(x && 1)],
2
);
assert.sameValue(
C[String(x && 1)],
2
);
assert.sameValue(x, 0);

View File

@ -52,5 +52,13 @@ assert.sameValue(
C[x || 1],
2
);
assert.sameValue(
c[String(x || 1)],
2
);
assert.sameValue(
C[String(x || 1)],
2
);
assert.sameValue(x, 0);

View File

@ -52,3 +52,11 @@ assert.sameValue(
C[f()],
1
);
assert.sameValue(
c[String(f())],
1
);
assert.sameValue(
C[String(f())],
1
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[function () {}],
1
);
assert.sameValue(
c[String(function () {})],
1
);
assert.sameValue(
C[String(function () {})],
1
);

View File

@ -52,3 +52,11 @@ assert.sameValue(
C[g()],
1
);
assert.sameValue(
c[String(g())],
1
);
assert.sameValue(
C[String(g())],
1
);

View File

@ -53,3 +53,11 @@ assert.sameValue(
C[x],
'2'
);
assert.sameValue(
c[String(x)],
'2'
);
assert.sameValue(
C[String(x)],
'2'
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1],
2
);
assert.sameValue(
c[String(1)],
2
);
assert.sameValue(
C[String(1)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1_2_3_4_5_6_7_8],
1_2_3_4_5_6_7_8
);
assert.sameValue(
c[String(1_2_3_4_5_6_7_8)],
1_2_3_4_5_6_7_8
);
assert.sameValue(
C[String(1_2_3_4_5_6_7_8)],
1_2_3_4_5_6_7_8
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1 + 2 - 3 * 4 / 5 ** 6],
2.999232
);
assert.sameValue(
c[String(1 + 2 - 3 * 4 / 5 ** 6)],
2.999232
);
assert.sameValue(
C[String(1 + 2 - 3 * 4 / 5 ** 6)],
2.999232
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1 / 1],
1
);
assert.sameValue(
c[String(1 / 1)],
1
);
assert.sameValue(
C[String(1 / 1)],
1
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1 * 1],
1
);
assert.sameValue(
c[String(1 * 1)],
1
);
assert.sameValue(
C[String(1 * 1)],
1
);

View File

@ -0,0 +1,61 @@
// This file was procedurally generated from the following sources:
// - src/computed-property-names/computed-property-name-from-null.case
// - src/computed-property-names/evaluation/class-expression-fields.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names]
flags: [generated]
info: |
ClassExpression:
classBindingIdentifier opt ClassTail
ClassTail:
ClassHeritage opt { ClassBody opt }
ClassBody:
ClassElementList
ClassElementList:
ClassElement
ClassElement:
MethodDefinition
MethodDefinition:
PropertyName ...
get PropertyName ...
set PropertyName ...
PropertyName:
ComputedPropertyName
ComputedPropertyName:
[ AssignmentExpression ]
---*/
let C = class {
[null] = null;
static [null] = null;
};
let c = new C();
assert.sameValue(
c[null],
null
);
assert.sameValue(
C[null],
null
);
assert.sameValue(
c[String(null)],
null
);
assert.sameValue(
C[String(null)],
null
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[1],
2
);
assert.sameValue(
c[String(1)],
2
);
assert.sameValue(
C[String(1)],
2
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C['1'],
'2'
);
assert.sameValue(
c[String('1')],
'2'
);
assert.sameValue(
C[String('1')],
'2'
);

View File

@ -51,3 +51,11 @@ assert.sameValue(
C[true ? 1 : 2],
2
);
assert.sameValue(
c[String(true ? 1 : 2)],
2
);
assert.sameValue(
C[String(true ? 1 : 2)],
2
);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[1 + 1](),
2
);
assert.sameValue(
c[String(1 + 1)](),
2
);
assert.sameValue(
C[String(1 + 1)](),
2
);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[1 - 1](),
0
);
assert.sameValue(
c[String(1 - 1)](),
0
);
assert.sameValue(
C[String(1 - 1)](),
0
);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[() => { }](),
1
);
assert.sameValue(
c[String(() => { })](),
1
);
assert.sameValue(
C[String(() => { })](),
1
);

View File

@ -56,5 +56,13 @@ assert.sameValue(
C[x = 1](),
2
);
assert.sameValue(
c[String(x = 1)](),
2
);
assert.sameValue(
C[String(x = 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -56,5 +56,13 @@ assert.sameValue(
C[x |= 1](),
2
);
assert.sameValue(
c[String(x |= 1)](),
2
);
assert.sameValue(
C[String(x |= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -56,5 +56,13 @@ assert.sameValue(
C[x ??= 1](),
2
);
assert.sameValue(
c[String(x ??= 1)](),
2
);
assert.sameValue(
C[String(x ??= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -56,5 +56,13 @@ assert.sameValue(
C[x &&= 1](),
2
);
assert.sameValue(
c[String(x &&= 1)](),
2
);
assert.sameValue(
C[String(x &&= 1)](),
2
);
assert.sameValue(x, 0);

View File

@ -56,5 +56,13 @@ assert.sameValue(
C[x ||= 1](),
2
);
assert.sameValue(
c[String(x ||= 1)](),
2
);
assert.sameValue(
C[String(x ||= 1)](),
2
);
assert.sameValue(x, 1);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[async () => {}](),
1
);
assert.sameValue(
c[String(async () => {})](),
1
);
assert.sameValue(
C[String(async () => {})](),
1
);

View File

@ -55,3 +55,11 @@ assert.sameValue(
C[false ? 1 : 2](),
1
);
assert.sameValue(
c[String(false ? 1 : 2)](),
1
);
assert.sameValue(
C[String(false ? 1 : 2)](),
1
);

Some files were not shown because too many files have changed in this diff Show More