diff --git a/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case b/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case deleted file mode 100644 index 7c117a00af..0000000000 --- a/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +++ /dev/null @@ -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; diff --git a/src/class-fields/literal-names-asi.case b/src/class-fields/literal-names-asi.case new file mode 100644 index 0000000000..8e7cd1bc36 --- /dev/null +++ b/src/class-fields/literal-names-asi.case @@ -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 +});