Skip to content
Snippets Groups Projects
Commit 889857cc authored by Valerie R Young's avatar Valerie R Young
Browse files

Fixes for forbidden property names

parent 2664e17e
No related branches found
No related tags found
No related merge requests found
Showing
with 55 additions and 11 deletions
......@@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static class fields cannot have PropName 'constructor'
desc: class fields forbid PropName 'constructor'
info: |
// This test file tests the following early error:
......
......@@ -4,7 +4,7 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-computed-name-
name: computed
name: no early error -- PropName of ComputedPropertyName not forbidden value
info: |
Static Semantics: PropName
...
......
......@@ -4,7 +4,7 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-literal-name-
name: literal name
name: early error -- PropName of IdentifierName is forbidden value
negative:
type: SyntaxError
phase: early
......
......@@ -4,14 +4,14 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-string-name-
name: string name
name: early error -- PropName of StringLiteral is forbidden value
negative:
type: SyntaxError
phase: early
info: |
Static Semantics: PropName
...
LiteralPropertyName:StringLiteral
LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral.
---*/
......
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/statements/class/fields-computed-variable-name-
name: no early error -- PropName of ComputedPropertyName not forbidden value
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
---*/
var /*{ propname }*/ = 'foo';
class C {
/*{ static }*/ [/*{ propname }*/];
}
var c = new C();
assert.sameValue(c.hasOwnProperty("foo"), true);
......@@ -4,7 +4,7 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-computed-name-
name: computed
name: no early error -- PropName of ComputedPropertyName not forbidden value
info: |
Static Semantics: PropName
...
......
......@@ -4,7 +4,7 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-literal-name-
name: literal name
name: early error -- PropName of IdentifierName is forbidden
negative:
type: SyntaxError
phase: early
......
......@@ -4,14 +4,14 @@
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-string-name-
name: string name
name: early error -- PropName of StringLiteral is forbidden
negative:
type: SyntaxError
phase: early
info: |
Static Semantics: PropName
...
LiteralPropertyName:StringLiteral
LiteralPropertyName : StringLiteral
Return the String value whose code units are the SV of the StringLiteral.
---*/
......
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-class-definitions-static-semantics-early-errors
path: language/expressions/class/fields-computed-variable-name-
name: no early error -- PropName of ComputedPropertyName not forbidden value
info: |
Static Semantics: PropName
...
ComputedPropertyName : [ AssignmentExpression ]
Return empty.
---*/
var /*{ propname }*/ = 'foo';
var C = class {
/*{ static }*/ [/*{ propname }*/];
}
var c = new C();
assert.sameValue(c.hasOwnProperty("foo"), true);
......@@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static class field cannot have PropName 'constructor'
desc: static class field forbid PropName 'constructor'
info: |
// This test file tests the following early error:
......
......@@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Static class fields cannot have PropName 'prototype'
desc: static class fields forbid PropName 'prototype'
info: |
// This test file tests the following early error:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment