Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed property names from await expression #2826

Merged
merged 4 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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, top-level-await]
flags: [async, module]
---*/
//- setup
try {
//- ComputedPropertyName
await 9
//- value
9
//- teardown
} catch (e) {
$DONE(e);
}
$DONE();
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// 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/class-expression-accessors.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names, top-level-await]
flags: [generated, async, module]
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 ]
---*/
try {


let C = class {
get [await 9]() {
return 9;
}

set [await 9](v) {
return 9;
}

static get [await 9]() {
return 9;
}

static set [await 9](v) {
return 9;
}
};

let c = new C();

assert.sameValue(
c[await 9],
9
);
assert.sameValue(
c[await 9] = 9,
9
);

assert.sameValue(
C[await 9],
9
);
assert.sameValue(
C[await 9] = 9,
9
);
assert.sameValue(
c[String(await 9)],
9
);
assert.sameValue(
c[String(await 9)] = 9,
9
);

assert.sameValue(
C[String(await 9)],
9
);
assert.sameValue(
C[String(await 9)] = 9,
9
);

} catch (e) {
$DONE(e);
}
$DONE();
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// 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/class-expression.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names, top-level-await]
flags: [generated, async, module]
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 ]
---*/
try {


let C = class {
[await 9]() {
return 9;
}
static [await 9]() {
return 9;
}
};

let c = new C();

assert.sameValue(
c[await 9](),
9
);
assert.sameValue(
C[await 9](),
9
);
assert.sameValue(
c[String(await 9)](),
9
);
assert.sameValue(
C[String(await 9)](),
9
);

} catch (e) {
$DONE(e);
}
$DONE();
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// 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/class-expression-fields.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names, top-level-await]
flags: [generated, async, module]
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 ]
---*/
try {


let C = class {
[await 9] = 9;

static [await 9] = 9;
};

let c = new C();

assert.sameValue(
c[await 9],
9
);
assert.sameValue(
C[await 9],
9
);
assert.sameValue(
c[String(await 9)],
9
);
assert.sameValue(
C[String(await 9)],
9
);

} catch (e) {
$DONE(e);
}
$DONE();
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// 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/class-expression-fields-methods.template
/*---
description: Computed property name from condition expression (ComputedPropertyName in ClassExpression)
esid: prod-ComputedPropertyName
features: [computed-property-names, top-level-await]
flags: [generated, async, module]
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 ]
---*/
try {


let C = class {
[await 9] = () => {
return 9;
};

static [await 9] = () => {
return 9;
};
};

let c = new C();

assert.sameValue(
c[await 9](),
9
);
assert.sameValue(
C[await 9](),
9
);
assert.sameValue(
c[String(await 9)](),
9
);
assert.sameValue(
C[String(await 9)](),
9
);

} catch (e) {
$DONE(e);
}
$DONE();
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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/object-literal.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();
Loading