mirror of https://github.com/tc39/test262.git
Add test for NamedEvaluation of Logical Assignment
This commit is contained in:
parent
ae0de0b6bb
commit
cbea466883
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical And Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression &&= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value &&= () => {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical And Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression &&= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value &&= class {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical And Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression &&= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value &&= function() {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Nullish Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ??= AssignmentExpression
|
||||
|
||||
4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ??= () => {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Nullish Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ??= AssignmentExpression
|
||||
|
||||
4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ??= class {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Nullish Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ??= AssignmentExpression
|
||||
|
||||
4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ??= function() {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Or Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ||= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ||= () => {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Or Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ||= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ||= class {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (c) 2020 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-assignment-operators-runtime-semantics-evaluation
|
||||
description: NamedEvaluation of Logical Or Assignment
|
||||
info: |
|
||||
AssignmentExpression:
|
||||
LeftHandSideExpression ||= AssignmentExpression
|
||||
|
||||
5. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
|
||||
a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
|
||||
features: [logical-assignment-operators]
|
||||
|
||||
---*/
|
||||
|
||||
var value = 1;
|
||||
value ||= function() {};
|
||||
|
||||
assert.sameValue(value.name, "value", "value");
|
Loading…
Reference in New Issue