Fixes for forbidden property names

# Conflicts:
#	src/class-fields/propname-error/cls-decl-variable-name.template
#	src/class-fields/propname-error/cls-expr-variable-name.template
This commit is contained in:
Valerie R Young 2017-10-31 14:19:30 -04:00 committed by Leo Balter
parent ea643db26f
commit d361aaadb8
4 changed files with 6 additions and 8 deletions

View File

@ -14,10 +14,9 @@ info: |
var /*{ propname }*/ = 'foo';
class C {
[/*{ propname }*/];
/*{ static }*/ [/*{ propname }*/];
}
var c = new C();
assert.sameValue(c.hasOwnProperty("foo"), true);
assert.sameValue(C.hasOwnProperty("foo"), false);

View File

@ -14,10 +14,9 @@ info: |
var /*{ propname }*/ = 'foo';
var C = class {
[/*{ propname }*/];
};
/*{ static }*/ [/*{ propname }*/];
}
var c = new C();
assert.sameValue(c.hasOwnProperty("foo"), true);
assert.sameValue(C.hasOwnProperty("foo"), false);
assert.sameValue(c.hasOwnProperty("foo"), true);

View File

@ -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:

View File

@ -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: