mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
d65346149e
commit
348a706c5d
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-expression-accessors.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,59 +33,62 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
get [true ? 1 : 2]() {
|
||||
return 2;
|
||||
get [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
set [true ? 1 : 2](v) {
|
||||
return 2;
|
||||
set [yield 9](v) {
|
||||
return 9;
|
||||
}
|
||||
|
||||
static get [true ? 1 : 2]() {
|
||||
return 2;
|
||||
static get [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
static set [true ? 1 : 2](v) {
|
||||
return 2;
|
||||
static set [yield 9](v) {
|
||||
return 9;
|
||||
}
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2],
|
||||
2
|
||||
c[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2] = 2,
|
||||
2
|
||||
c[yield 9] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2],
|
||||
2
|
||||
C[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2] = 2,
|
||||
2
|
||||
C[yield 9] = 9,
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)],
|
||||
2
|
||||
c[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)] = 2,
|
||||
2
|
||||
c[String(yield 9)] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)],
|
||||
2
|
||||
C[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)] = 2,
|
||||
2
|
||||
C[String(yield 9)] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,32 +33,35 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
[true ? 1 : 2]() {
|
||||
return 2;
|
||||
[yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
static [true ? 1 : 2]() {
|
||||
return 2;
|
||||
static [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2](),
|
||||
2
|
||||
c[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2](),
|
||||
2
|
||||
C[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)](),
|
||||
2
|
||||
c[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)](),
|
||||
2
|
||||
C[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-expression-fields.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,29 +33,32 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
[true ? 1 : 2] = 2;
|
||||
[yield 9] = 9;
|
||||
|
||||
static [true ? 1 : 2] = 2;
|
||||
static [yield 9] = 9;
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2],
|
||||
2
|
||||
c[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2],
|
||||
2
|
||||
C[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)],
|
||||
2
|
||||
c[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)],
|
||||
2
|
||||
C[String(yield 9)],
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-expression-fields-methods.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,33 +33,36 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
[true ? 1 : 2] = () => {
|
||||
return 2;
|
||||
[yield 9] = () => {
|
||||
return 9;
|
||||
};
|
||||
|
||||
static [true ? 1 : 2] = () => {
|
||||
return 2;
|
||||
static [yield 9] = () => {
|
||||
return 9;
|
||||
};
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2](),
|
||||
2
|
||||
c[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2](),
|
||||
2
|
||||
C[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)](),
|
||||
2
|
||||
c[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)](),
|
||||
2
|
||||
C[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/object-literal.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -22,17 +22,20 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let o = {
|
||||
[true ? 1 : 2]: 2
|
||||
[yield 9]: 9
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[true ? 1 : 2],
|
||||
2
|
||||
o[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(true ? 1 : 2)],
|
||||
2
|
||||
o[String(yield 9)],
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-additive-expression-add.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from additive expression "add" (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1 + 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1 + 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1 + 1)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-additive-expression-subtract.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from additive expression "subtract" (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1 - 1]: 0
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1 - 1],
|
||||
0
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1 - 1)],
|
||||
0
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-arrow-function-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from arrow function (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[() => { }]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[() => { }],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(() => { })],
|
||||
1
|
||||
);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-assignment-expression-assignment.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from assignment expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x = 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x = 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x = 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 1);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-assignment-expression-bitwise-or.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from assignment expression bitwise or (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x |= 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x |= 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x |= 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 1);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-assignment-expression-coalesce.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from assignment expression coalesce (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
|
||||
let o = {
|
||||
[x ??= 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x ??= 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x ??= 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 1);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-and.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from assignment expression logical and (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x &&= 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x &&= 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x &&= 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 0);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-assignment-expression-logical-or.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from assignment expression logical or (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x ||= 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x ||= 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x ||= 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 1);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-async-arrow-function-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from function expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[async () => {}]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[async () => {}],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(async () => {})],
|
||||
1
|
||||
);
|
|
@ -1,44 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-await-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names, top-level-await]
|
||||
flags: [generated, async, module]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
try {
|
||||
|
||||
|
||||
let o = {
|
||||
[await 9]: 9
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[await 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(await 9)],
|
||||
9
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
$DONE(e);
|
||||
}
|
||||
$DONE();
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-condition-expression-false.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[false ? 1 : 2]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[false ? 1 : 2],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(false ? 1 : 2)],
|
||||
1
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-condition-expression-true.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[true ? 1 : 2]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[true ? 1 : 2],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(true ? 1 : 2)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-decimal-e-notational-literal.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from decimal e notational literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1.e1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1.e1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1.e1)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-decimal-literal.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from decimal literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1.1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1.1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1.1)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-exponetiation-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from exponentiation expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[2 ** 2]: 4
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[2 ** 2],
|
||||
4
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(2 ** 2)],
|
||||
4
|
||||
);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-expression-coalesce.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from coalesce (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
|
||||
let o = {
|
||||
[x ?? 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x ?? 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x ?? 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, undefined);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-expression-logical-and.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from logical and (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x && 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x && 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x && 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 0);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-expression-logical-or.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from logical or (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 0;
|
||||
|
||||
|
||||
let o = {
|
||||
[x || 1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x || 1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x || 1)],
|
||||
2
|
||||
);
|
||||
|
||||
assert.sameValue(x, 0);
|
|
@ -1,39 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-function-declaration.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from function (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function f() {}
|
||||
|
||||
|
||||
let o = {
|
||||
[f()]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[f()],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(f())],
|
||||
1
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-function-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from function expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[function () {}]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[function () {}],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(function () {})],
|
||||
1
|
||||
);
|
|
@ -1,39 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-generator-function-declaration.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from generator function (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() { return 1; }
|
||||
|
||||
|
||||
let o = {
|
||||
[g()]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[g()],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(g())],
|
||||
1
|
||||
);
|
|
@ -1,40 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-identifier.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from string literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
let x = 1;
|
||||
|
||||
|
||||
|
||||
let o = {
|
||||
[x]: '2'
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[x],
|
||||
'2'
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(x)],
|
||||
'2'
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-integer-e-notational-literal.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from numeric literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-integer-separators.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from integer with separators (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1_2_3_4_5_6_7_8]: 1_2_3_4_5_6_7_8
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1_2_3_4_5_6_7_8],
|
||||
1_2_3_4_5_6_7_8
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1_2_3_4_5_6_7_8)],
|
||||
1_2_3_4_5_6_7_8
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-math.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from math (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1 + 2 - 3 * 4 / 5 ** 6]: 2.999232
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1 + 2 - 3 * 4 / 5 ** 6],
|
||||
2.999232
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1 + 2 - 3 * 4 / 5 ** 6)],
|
||||
2.999232
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-multiplicative-expression-div.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from multiplicative expression "divide" (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1 / 1]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1 / 1],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1 / 1)],
|
||||
1
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-multiplicative-expression-mult.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from multiplicative expression "multiply" (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1 * 1]: 1
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1 * 1],
|
||||
1
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1 * 1)],
|
||||
1
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-null.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[null]: null
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[null],
|
||||
null
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(null)],
|
||||
null
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-numeric-literal.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from numeric literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[1]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[1],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(1)],
|
||||
2
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-string-literal.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from string literal (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
['1']: '2'
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o['1'],
|
||||
'2'
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String('1')],
|
||||
'2'
|
||||
);
|
|
@ -1,38 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/yield-expression.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ObjectLiteral)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
info: |
|
||||
ObjectLiteral:
|
||||
{ PropertyDefinitionList }
|
||||
|
||||
PropertyDefinitionList:
|
||||
PropertyDefinition
|
||||
|
||||
PropertyDefinition:
|
||||
PropertyName: AssignmentExpression
|
||||
|
||||
PropertyName:
|
||||
ComputedPropertyName
|
||||
|
||||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
|
||||
|
||||
let o = {
|
||||
[true ? 1 : 2]: 2
|
||||
};
|
||||
|
||||
assert.sameValue(
|
||||
o[true ? 1 : 2],
|
||||
2
|
||||
);
|
||||
assert.sameValue(
|
||||
o[String(true ? 1 : 2)],
|
||||
2
|
||||
);
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-declaration-accessors.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassDeclaration)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,59 +33,62 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
class C {
|
||||
get [true ? 1 : 2]() {
|
||||
return 2;
|
||||
get [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
set [true ? 1 : 2](v) {
|
||||
return 2;
|
||||
set [yield 9](v) {
|
||||
return 9;
|
||||
}
|
||||
|
||||
static get [true ? 1 : 2]() {
|
||||
return 2;
|
||||
static get [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
|
||||
static set [true ? 1 : 2](v) {
|
||||
return 2;
|
||||
static set [yield 9](v) {
|
||||
return 9;
|
||||
}
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2],
|
||||
2
|
||||
c[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2] = 2,
|
||||
2
|
||||
c[yield 9] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2],
|
||||
2
|
||||
C[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2] = 2,
|
||||
2
|
||||
C[yield 9] = 9,
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)],
|
||||
2
|
||||
c[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)] = 2,
|
||||
2
|
||||
c[String(yield 9)] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)],
|
||||
2
|
||||
C[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)] = 2,
|
||||
2
|
||||
C[String(yield 9)] = 9,
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-declaration.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassDeclaration)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassDeclaration)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,32 +33,35 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
class C {
|
||||
[true ? 1 : 2]() {
|
||||
return 2;
|
||||
[yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
static [true ? 1 : 2]() {
|
||||
return 2;
|
||||
static [yield 9]() {
|
||||
return 9;
|
||||
}
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2](),
|
||||
2
|
||||
c[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2](),
|
||||
2
|
||||
C[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)](),
|
||||
2
|
||||
c[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)](),
|
||||
2
|
||||
C[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-declaration-fields.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,29 +33,32 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
[true ? 1 : 2] = 2;
|
||||
[yield 9] = 9;
|
||||
|
||||
static [true ? 1 : 2] = 2;
|
||||
static [yield 9] = 9;
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2],
|
||||
2
|
||||
c[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2],
|
||||
2
|
||||
C[yield 9],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)],
|
||||
2
|
||||
c[String(yield 9)],
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)],
|
||||
2
|
||||
C[String(yield 9)],
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// - src/computed-property-names/computed-property-name-from-yield-expression.case
|
||||
// - src/computed-property-names/evaluation/class-declaration-fields-methods.template
|
||||
/*---
|
||||
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
|
||||
description: Computed property name from yield expression (ComputedPropertyName in ClassExpression)
|
||||
esid: prod-ComputedPropertyName
|
||||
features: [computed-property-names]
|
||||
flags: [generated]
|
||||
|
@ -33,33 +33,36 @@ info: |
|
|||
ComputedPropertyName:
|
||||
[ AssignmentExpression ]
|
||||
---*/
|
||||
function * g() {
|
||||
|
||||
|
||||
let C = class {
|
||||
[true ? 1 : 2] = () => {
|
||||
return 2;
|
||||
[yield 9] = () => {
|
||||
return 9;
|
||||
};
|
||||
|
||||
static [true ? 1 : 2] = () => {
|
||||
return 2;
|
||||
static [yield 9] = () => {
|
||||
return 9;
|
||||
};
|
||||
};
|
||||
|
||||
let c = new C();
|
||||
|
||||
assert.sameValue(
|
||||
c[true ? 1 : 2](),
|
||||
2
|
||||
c[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[true ? 1 : 2](),
|
||||
2
|
||||
C[yield 9](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
c[String(true ? 1 : 2)](),
|
||||
2
|
||||
c[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
assert.sameValue(
|
||||
C[String(true ? 1 : 2)](),
|
||||
2
|
||||
C[String(yield 9)](),
|
||||
9
|
||||
);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue