Fix cases for ASI

This commit is contained in:
Leo Balter 2018-08-20 13:31:10 -04:00
parent c5a1a4a24b
commit d4fc8d6fc9
2 changed files with 42 additions and 27 deletions

View File

@ -1,27 +0,0 @@
// Copyright (C) 2018 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: SyntaxError
info: |
ClassElement :
MethodDefinition
static MethodDefinition
FieldDefinition ;
;
FieldDefinition :
ClassElementName Initializer _opt
ClassElementName :
PropertyName
PrivateName
template: syntax/invalid
features: [class-fields-private]
---*/
//- fields
x = []
y;

View File

@ -0,0 +1,42 @@
// Copyright (C) 2017 the V8 project authors, 2017 Igalia S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Literal property names with ASI
info: |
ClassElement:
...
FieldDefinition ;
FieldDefinition:
ClassElementName Initializer_opt
ClassElementName:
PropertyName
template: productions
includes: [propertyHelper.js]
---*/
//- fields
a
b = 42;
//- assertions
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false);
assert.sameValue(Object.hasOwnProperty.call(C, "a"), false);
verifyProperty(c, "a", {
value: undefined,
enumerable: true,
writable: true,
configurable: true
});
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false);
assert.sameValue(Object.hasOwnProperty.call(C, "b"), false);
verifyProperty(c, "b", {
value: 42,
enumerable: true,
writable: true,
configurable: true
});