From e731114cff0a59936c5117f42d2d618c19920fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xan=20L=C3=B3pez?= <xan@igalia.com> Date: Wed, 14 Jun 2017 16:43:45 +0200 Subject: [PATCH] Add initial set of class field tests (from V8's test-parsing.cc) At this point this requires Babel for testing, but most tests in this commit won't pass until this is fixed: https://github.com/babel/babel/issues/5056 --- ...mpty-var-computed-name-empty-function.case | 29 +++++++++++++++++ ...omputed-name-empty-var-empty-function.case | 29 +++++++++++++++++ .../computed-name-empty-var-empty-var.case | 30 ++++++++++++++++++ ...me-empty-var-generator-empty-function.case | 29 +++++++++++++++++ .../computed-name-empty-var-new-line-asi.case | 25 +++++++++++++++ ...line-computed-name-empty-function-asi.case | 29 +++++++++++++++++ ...empty-var-new-line-empty-function-asi.case | 29 +++++++++++++++++ ...name-empty-var-new-line-empty-var-asi.case | 30 ++++++++++++++++++ ...new-line-generator-empty-function-asi.case | 29 +++++++++++++++++ src/class-fields/computed-name-empty-var.case | 25 +++++++++++++++ ...ro-initializer-new-line-empty-bar-asi.case | 30 ++++++++++++++++++ ...itializer-new-line-empty-function-asi.case | 29 +++++++++++++++++ ...ro-initializer-new-line-empty-var-asi.case | 30 ++++++++++++++++++ ...izer-var-computed-name-empty-function.case | 29 +++++++++++++++++ ...e-zero-initializer-var-empty-function.case | 29 +++++++++++++++++ ...d-name-zero-initializer-var-empty-var.case | 30 ++++++++++++++++++ ...tializer-var-generator-empty-function.case | 29 +++++++++++++++++ ...ame-zero-initializer-var-new-line-asi.case | 25 +++++++++++++++ .../computed-name-zero-initializer-var.case | 25 +++++++++++++++ .../default/cls-decl-extends.template | 18 +++++++++++ src/class-fields/default/cls-decl.template | 16 ++++++++++ src/class-fields/double-empty-var.case | 30 ++++++++++++++++++ src/class-fields/empty-string-var.case | 25 +++++++++++++++ ...mpty-var-computed-name-empty-function.case | 29 +++++++++++++++++ .../empty-var-empty-function.case | 29 +++++++++++++++++ .../empty-var-generator-empty-function.case | 29 +++++++++++++++++ src/class-fields/empty-var-new-line-asi.case | 25 +++++++++++++++ ...r-new-line-computed-name-function-asi.case | 29 +++++++++++++++++ ...empty-var-new-line-empty-function-asi.case | 29 +++++++++++++++++ ...y-var-new-line-empty-var-new-line-asi.case | 31 +++++++++++++++++++ ...new-line-generator-empty-function-asi.case | 29 +++++++++++++++++ src/class-fields/empty-var.case | 25 +++++++++++++++ .../string-zero-initializer-var.case | 25 +++++++++++++++ .../undefined-initializer-var.case | 25 +++++++++++++++ src/class-fields/yield-var.case | 25 +++++++++++++++ .../yield-zero-initializer-var.case | 25 +++++++++++++++ src/class-fields/zero-empty-var.case | 25 +++++++++++++++ ...izer-var-computed-name-empty-function.case | 29 +++++++++++++++++ .../zero-initializer-var-empty-function.case | 29 +++++++++++++++++ .../zero-initializer-var-empty-var.case | 30 ++++++++++++++++++ ...tializer-var-generator-empty-function.case | 29 +++++++++++++++++ .../zero-initializer-var-new-line-asi.case | 25 +++++++++++++++ ...lizer-var-new-line-empty-function-asi.case | 30 ++++++++++++++++++ ...nitializer-var-new-line-empty-var-asi.case | 31 +++++++++++++++++++ src/class-fields/zero-initializer-var.case | 25 +++++++++++++++ .../zero-zero-initializer-var.case | 25 +++++++++++++++ 46 files changed, 1262 insertions(+) create mode 100644 src/class-fields/computed-name-empty-var-computed-name-empty-function.case create mode 100644 src/class-fields/computed-name-empty-var-empty-function.case create mode 100644 src/class-fields/computed-name-empty-var-empty-var.case create mode 100644 src/class-fields/computed-name-empty-var-generator-empty-function.case create mode 100644 src/class-fields/computed-name-empty-var-new-line-asi.case create mode 100644 src/class-fields/computed-name-empty-var-new-line-computed-name-empty-function-asi.case create mode 100644 src/class-fields/computed-name-empty-var-new-line-empty-function-asi.case create mode 100644 src/class-fields/computed-name-empty-var-new-line-empty-var-asi.case create mode 100644 src/class-fields/computed-name-empty-var-new-line-generator-empty-function-asi.case create mode 100644 src/class-fields/computed-name-empty-var.case create mode 100644 src/class-fields/computed-name-zero-initializer-new-line-empty-bar-asi.case create mode 100644 src/class-fields/computed-name-zero-initializer-new-line-empty-function-asi.case create mode 100644 src/class-fields/computed-name-zero-initializer-new-line-empty-var-asi.case create mode 100644 src/class-fields/computed-name-zero-initializer-var-computed-name-empty-function.case create mode 100644 src/class-fields/computed-name-zero-initializer-var-empty-function.case create mode 100644 src/class-fields/computed-name-zero-initializer-var-empty-var.case create mode 100644 src/class-fields/computed-name-zero-initializer-var-generator-empty-function.case create mode 100644 src/class-fields/computed-name-zero-initializer-var-new-line-asi.case create mode 100644 src/class-fields/computed-name-zero-initializer-var.case create mode 100644 src/class-fields/default/cls-decl-extends.template create mode 100644 src/class-fields/default/cls-decl.template create mode 100644 src/class-fields/double-empty-var.case create mode 100644 src/class-fields/empty-string-var.case create mode 100644 src/class-fields/empty-var-computed-name-empty-function.case create mode 100644 src/class-fields/empty-var-empty-function.case create mode 100644 src/class-fields/empty-var-generator-empty-function.case create mode 100644 src/class-fields/empty-var-new-line-asi.case create mode 100644 src/class-fields/empty-var-new-line-computed-name-function-asi.case create mode 100644 src/class-fields/empty-var-new-line-empty-function-asi.case create mode 100644 src/class-fields/empty-var-new-line-empty-var-new-line-asi.case create mode 100644 src/class-fields/empty-var-new-line-generator-empty-function-asi.case create mode 100644 src/class-fields/empty-var.case create mode 100644 src/class-fields/string-zero-initializer-var.case create mode 100644 src/class-fields/undefined-initializer-var.case create mode 100644 src/class-fields/yield-var.case create mode 100644 src/class-fields/yield-zero-initializer-var.case create mode 100644 src/class-fields/zero-empty-var.case create mode 100644 src/class-fields/zero-initializer-var-computed-name-empty-function.case create mode 100644 src/class-fields/zero-initializer-var-empty-function.case create mode 100644 src/class-fields/zero-initializer-var-empty-var.case create mode 100644 src/class-fields/zero-initializer-var-generator-empty-function.case create mode 100644 src/class-fields/zero-initializer-var-new-line-asi.case create mode 100644 src/class-fields/zero-initializer-var-new-line-empty-function-asi.case create mode 100644 src/class-fields/zero-initializer-var-new-line-empty-var-asi.case create mode 100644 src/class-fields/zero-initializer-var.case create mode 100644 src/class-fields/zero-zero-initializer-var.case diff --git a/src/class-fields/computed-name-empty-var-computed-name-empty-function.case b/src/class-fields/computed-name-empty-var-computed-name-empty-function.case new file mode 100644 index 0000000000..a6aed9f894 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-computed-name-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var not initialized, computed name function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a']; ['b'](){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var-empty-function.case b/src/class-fields/computed-name-empty-var-empty-function.case new file mode 100644 index 0000000000..5feacdca35 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var not initialized, empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a']; b(){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var-empty-var.case b/src/class-fields/computed-name-empty-var-empty-var.case new file mode 100644 index 0000000000..af98e9c968 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-empty-var.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: Computed name var not initialized, var not initialized +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a']; b + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/computed-name-empty-var-generator-empty-function.case b/src/class-fields/computed-name-empty-var-generator-empty-function.case new file mode 100644 index 0000000000..39a1de7de1 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-generator-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var not initialized, generator empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a']; *b(){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var-new-line-asi.case b/src/class-fields/computed-name-empty-var-new-line-asi.case new file mode 100644 index 0000000000..84e9e7d06f --- /dev/null +++ b/src/class-fields/computed-name-empty-var-new-line-asi.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: computed name empty var and newline (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/computed-name-empty-var-new-line-computed-name-empty-function-asi.case b/src/class-fields/computed-name-empty-var-new-line-computed-name-empty-function-asi.case new file mode 100644 index 0000000000..93d034fad2 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-new-line-computed-name-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: computed name empty var and newline, computed name empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] + ['b'](){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var-new-line-empty-function-asi.case b/src/class-fields/computed-name-empty-var-new-line-empty-function-asi.case new file mode 100644 index 0000000000..d908715a16 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-new-line-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: computed name empty var and newline, empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] + b(){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var-new-line-empty-var-asi.case b/src/class-fields/computed-name-empty-var-new-line-empty-var-asi.case new file mode 100644 index 0000000000..139ac66ee2 --- /dev/null +++ b/src/class-fields/computed-name-empty-var-new-line-empty-var-asi.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: computed name empty var and newline, empty var (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] + b +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/computed-name-empty-var-new-line-generator-empty-function-asi.case b/src/class-fields/computed-name-empty-var-new-line-generator-empty-function-asi.case new file mode 100644 index 0000000000..f5cbdbc62f --- /dev/null +++ b/src/class-fields/computed-name-empty-var-new-line-generator-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: computed name empty var and newline, generator empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] + *b(){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-empty-var.case b/src/class-fields/computed-name-empty-var.case new file mode 100644 index 0000000000..5a2c3b0e47 --- /dev/null +++ b/src/class-fields/computed-name-empty-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: Computed name var not initialized +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a']; + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/computed-name-zero-initializer-new-line-empty-bar-asi.case b/src/class-fields/computed-name-zero-initializer-new-line-empty-bar-asi.case new file mode 100644 index 0000000000..76cfe5ab44 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-new-line-empty-bar-asi.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: computed name zero initialized var and newline, empty var (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0 + b +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/computed-name-zero-initializer-new-line-empty-function-asi.case b/src/class-fields/computed-name-zero-initializer-new-line-empty-function-asi.case new file mode 100644 index 0000000000..ea66279a76 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-new-line-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: computed name zero initialized var and newline, empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0 + b(){} +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-zero-initializer-new-line-empty-var-asi.case b/src/class-fields/computed-name-zero-initializer-new-line-empty-var-asi.case new file mode 100644 index 0000000000..76cfe5ab44 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-new-line-empty-var-asi.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: computed name zero initialized var and newline, empty var (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0 + b +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/computed-name-zero-initializer-var-computed-name-empty-function.case b/src/class-fields/computed-name-zero-initializer-var-computed-name-empty-function.case new file mode 100644 index 0000000000..58a136c039 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var-computed-name-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var zero initialized, computed name empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0; ['b'](){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-zero-initializer-var-empty-function.case b/src/class-fields/computed-name-zero-initializer-var-empty-function.case new file mode 100644 index 0000000000..9b11074b7c --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var zero initialized, empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0; b(){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-zero-initializer-var-empty-var.case b/src/class-fields/computed-name-zero-initializer-var-empty-var.case new file mode 100644 index 0000000000..5653b8d5b9 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var-empty-var.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: Computed name var zero initialized, empty var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0; b + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/computed-name-zero-initializer-var-generator-empty-function.case b/src/class-fields/computed-name-zero-initializer-var-generator-empty-function.case new file mode 100644 index 0000000000..c4ac672307 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var-generator-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Computed name var zero initialized, generator empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0; *b(){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/computed-name-zero-initializer-var-new-line-asi.case b/src/class-fields/computed-name-zero-initializer-var-new-line-asi.case new file mode 100644 index 0000000000..8fe58c0be3 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var-new-line-asi.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: computed name zero initialized var and newline (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0 + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/computed-name-zero-initializer-var.case b/src/class-fields/computed-name-zero-initializer-var.case new file mode 100644 index 0000000000..c2dc168eb7 --- /dev/null +++ b/src/class-fields/computed-name-zero-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: Computed name var zero initialized +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + ['a'] = 0; + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/default/cls-decl-extends.template b/src/class-fields/default/cls-decl-extends.template new file mode 100644 index 0000000000..2cc6dd63f4 --- /dev/null +++ b/src/class-fields/default/cls-decl-extends.template @@ -0,0 +1,18 @@ +// Copyright (C) 2016 the V8 project authors, 2017 Igalia S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/expressions/class/class-field-extends- +name: class fields +---*/ + +class Base {} +class C extends Base { + /*{ body }*/ + constructor() { + super(); + /*{ assertions }*/ + } +} + +const c = new C(); diff --git a/src/class-fields/default/cls-decl.template b/src/class-fields/default/cls-decl.template new file mode 100644 index 0000000000..92dcfd74e3 --- /dev/null +++ b/src/class-fields/default/cls-decl.template @@ -0,0 +1,16 @@ +// Copyright (C) 2016 the V8 project authors, 2017 Igalia S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/expressions/class/class-field- +name: class fields +---*/ + +class C { + /*{ body }*/ + constructor() { + /*{ assertions }*/ + } +} + +const c = new C(); diff --git a/src/class-fields/double-empty-var.case b/src/class-fields/double-empty-var.case new file mode 100644 index 0000000000..6da7714490 --- /dev/null +++ b/src/class-fields/double-empty-var.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: Empty var, empty var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a; b; + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/empty-string-var.case b/src/class-fields/empty-string-var.case new file mode 100644 index 0000000000..86666052ff --- /dev/null +++ b/src/class-fields/empty-string-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: Empty string var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + 'a'; + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/empty-var-computed-name-empty-function.case b/src/class-fields/empty-var-computed-name-empty-function.case new file mode 100644 index 0000000000..3a56f21796 --- /dev/null +++ b/src/class-fields/empty-var-computed-name-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: empty var, computed name empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a; ['b'](){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var-empty-function.case b/src/class-fields/empty-var-empty-function.case new file mode 100644 index 0000000000..43b39b27c2 --- /dev/null +++ b/src/class-fields/empty-var-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Empty var, empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a; b(){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var-generator-empty-function.case b/src/class-fields/empty-var-generator-empty-function.case new file mode 100644 index 0000000000..a9f86fa455 --- /dev/null +++ b/src/class-fields/empty-var-generator-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: Empty var, generator empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a; *b(){} + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var-new-line-asi.case b/src/class-fields/empty-var-new-line-asi.case new file mode 100644 index 0000000000..0c68ce995b --- /dev/null +++ b/src/class-fields/empty-var-new-line-asi.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: empty var and newline (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/empty-var-new-line-computed-name-function-asi.case b/src/class-fields/empty-var-new-line-computed-name-function-asi.case new file mode 100644 index 0000000000..fe9551455e --- /dev/null +++ b/src/class-fields/empty-var-new-line-computed-name-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: empty var and newline, computed name empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a + ['b'](){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var-new-line-empty-function-asi.case b/src/class-fields/empty-var-new-line-empty-function-asi.case new file mode 100644 index 0000000000..7002cab0c0 --- /dev/null +++ b/src/class-fields/empty-var-new-line-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: empty var and newline, empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a + b(){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var-new-line-empty-var-new-line-asi.case b/src/class-fields/empty-var-new-line-empty-var-new-line-asi.case new file mode 100644 index 0000000000..c58ef27560 --- /dev/null +++ b/src/class-fields/empty-var-new-line-empty-var-new-line-asi.case @@ -0,0 +1,31 @@ +// Copyright (C) 2016 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: empty var and newline, empty var and newline (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a + b + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/empty-var-new-line-generator-empty-function-asi.case b/src/class-fields/empty-var-new-line-generator-empty-function-asi.case new file mode 100644 index 0000000000..816bb591b9 --- /dev/null +++ b/src/class-fields/empty-var-new-line-generator-empty-function-asi.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: empty var and newline, generator empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a + *b(){} +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/empty-var.case b/src/class-fields/empty-var.case new file mode 100644 index 0000000000..43392b65b4 --- /dev/null +++ b/src/class-fields/empty-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: Empty var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a; + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/string-zero-initializer-var.case b/src/class-fields/string-zero-initializer-var.case new file mode 100644 index 0000000000..a6ab7c7f8f --- /dev/null +++ b/src/class-fields/string-zero-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: string var zero initializer +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + 'a' = 0; + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/undefined-initializer-var.case b/src/class-fields/undefined-initializer-var.case new file mode 100644 index 0000000000..391bdb3eec --- /dev/null +++ b/src/class-fields/undefined-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: Empty var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = undefined; + +//- assertions + assert.sameValue(this.a, undefined); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/yield-var.case b/src/class-fields/yield-var.case new file mode 100644 index 0000000000..abc30f2fe7 --- /dev/null +++ b/src/class-fields/yield-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: yield var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + yield + +//- assertions + assert.sameValue(this.yield, undefined); + verifyEnumerable(this, "yield"); + verifyWritable(this, "yield"); + verifyConfigurable(this, "yield"); diff --git a/src/class-fields/yield-zero-initializer-var.case b/src/class-fields/yield-zero-initializer-var.case new file mode 100644 index 0000000000..e677466bf6 --- /dev/null +++ b/src/class-fields/yield-zero-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: yield var zero initialized +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + yield = 0 + +//- assertions + assert.sameValue(this.yield, 0); + verifyEnumerable(this, "yield"); + verifyWritable(this, "yield"); + verifyConfigurable(this, "yield"); diff --git a/src/class-fields/zero-empty-var.case b/src/class-fields/zero-empty-var.case new file mode 100644 index 0000000000..ae21356484 --- /dev/null +++ b/src/class-fields/zero-empty-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: zero var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + 0; + +//- assertions + assert.sameValue(this["0"], undefined); + verifyEnumerable(this, "0"); + verifyWritable(this, "0"); + verifyConfigurable(this, "0"); diff --git a/src/class-fields/zero-initializer-var-computed-name-empty-function.case b/src/class-fields/zero-initializer-var-computed-name-empty-function.case new file mode 100644 index 0000000000..195626c747 --- /dev/null +++ b/src/class-fields/zero-initializer-var-computed-name-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: zero initialized var, computed name empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0; ['b'](){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/zero-initializer-var-empty-function.case b/src/class-fields/zero-initializer-var-empty-function.case new file mode 100644 index 0000000000..d6033029c0 --- /dev/null +++ b/src/class-fields/zero-initializer-var-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: zero initialized var, empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0; b(){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/zero-initializer-var-empty-var.case b/src/class-fields/zero-initializer-var-empty-var.case new file mode 100644 index 0000000000..93a7940950 --- /dev/null +++ b/src/class-fields/zero-initializer-var-empty-var.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: zero initialized var, empty var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0; b + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/zero-initializer-var-generator-empty-function.case b/src/class-fields/zero-initializer-var-generator-empty-function.case new file mode 100644 index 0000000000..688d24e601 --- /dev/null +++ b/src/class-fields/zero-initializer-var-generator-empty-function.case @@ -0,0 +1,29 @@ +// Copyright (C) 2016 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: zero initialized var, generator empty function +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0; *b(){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/zero-initializer-var-new-line-asi.case b/src/class-fields/zero-initializer-var-new-line-asi.case new file mode 100644 index 0000000000..f4144acf00 --- /dev/null +++ b/src/class-fields/zero-initializer-var-new-line-asi.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: zero initialized var and newline (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0 + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/zero-initializer-var-new-line-empty-function-asi.case b/src/class-fields/zero-initializer-var-new-line-empty-function-asi.case new file mode 100644 index 0000000000..8a3c24a856 --- /dev/null +++ b/src/class-fields/zero-initializer-var-new-line-empty-function-asi.case @@ -0,0 +1,30 @@ +// Copyright (C) 2016 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: zero initialized var and newline, empty function (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0 + b(){} + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(typeof Object.getPrototypeOf(this).b, "function"); + verifyNotEnumerable(Object.getPrototypeOf(this), "b"); + verifyConfigurable(Object.getPrototypeOf(this), "b"); diff --git a/src/class-fields/zero-initializer-var-new-line-empty-var-asi.case b/src/class-fields/zero-initializer-var-new-line-empty-var-asi.case new file mode 100644 index 0000000000..46c13df924 --- /dev/null +++ b/src/class-fields/zero-initializer-var-new-line-empty-var-asi.case @@ -0,0 +1,31 @@ +// Copyright (C) 2016 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: zero initialized var and newline, empty var (ASI) +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0 + b + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); + + assert.sameValue(this.b, undefined); + verifyEnumerable(this, "b"); + verifyWritable(this, "b"); + verifyConfigurable(this, "b"); diff --git a/src/class-fields/zero-initializer-var.case b/src/class-fields/zero-initializer-var.case new file mode 100644 index 0000000000..b2f10211cc --- /dev/null +++ b/src/class-fields/zero-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: zero initialized var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + a = 0; + +//- assertions + assert.sameValue(this.a, 0); + verifyEnumerable(this, "a"); + verifyWritable(this, "a"); + verifyConfigurable(this, "a"); diff --git a/src/class-fields/zero-zero-initializer-var.case b/src/class-fields/zero-zero-initializer-var.case new file mode 100644 index 0000000000..64ad15f903 --- /dev/null +++ b/src/class-fields/zero-zero-initializer-var.case @@ -0,0 +1,25 @@ +// Copyright (C) 2016 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: zero initialized zero var +info: | + 1.1 New Productions + + [...] + + FieldDefinitionList [Yield, Await]: + FieldDefinition [?Yield, ?Await] + FieldDefinitionList [?Yield, ?Await], FieldDefinition [?Yield, ?Await] +template: default +includes: [propertyHelper.js] +---*/ + +//- body + 0 = 0; + +//- assertions + assert.sameValue(this["0"], 0); + verifyEnumerable(this, "0"); + verifyWritable(this, "0"); + verifyConfigurable(this, "0"); -- GitLab