Skip to content

Commit f72b125

Browse files
committed
Final tests
1 parent 813e2af commit f72b125

File tree

100 files changed

+1060
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1060
-94
lines changed

src/decorator/accessor-deco-invalid-return-get.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator cannot return invalid getter
77
template: accessors/error/**/*
88
features: [decorators]

src/decorator/accessor-deco-invalid-return-init.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator cannot return invalid init
77
template: accessors/error/**/*
88
features: [decorators]

src/decorator/accessor-deco-invalid-return-set.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator cannot return invalid setter
77
template: accessors/error/**/*
88
features: [decorators]

src/decorator/accessor-deco-invalid-return.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator cannot return invalid init
77
template: accessors/error/**/*
88
features: [decorators]

src/decorator/accessor-deco-returns-get.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new getter
77
template: accessors/standard/**/*
88
features: [decorators]

src/decorator/accessor-deco-returns-init.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new init
77
template: accessors/standard/**/*
88
features: [decorators]

src/decorator/accessor-deco-returns-set.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new getter
77
template: accessors/standard/**/*
88
features: [decorators]

src/decorator/accessor-with-init-deco-returns-get.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new getter
77
template: accessors/with-init/**/*
88
features: [decorators]

src/decorator/accessor-with-init-deco-returns-init.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new init that chains with default initializer
77
template: accessors/with-init/**/*
88
features: [decorators]

src/decorator/accessor-with-init-deco-returns-set.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Accessor decorator can return a new setter when initializer is present
77
template: accessors/with-init/**/*
88
features: [decorators]

src/decorator/class-deco-invalid-return-arrow.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator cannot return non-newable function (arrow)
77
template: class/error
88
features: [decorators]

src/decorator/class-deco-invalid-return-primitive.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-initializefieldoraccessor
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator cannot return a random non-newable value
77
template: class/error
88
features: [decorators]

src/decorator/class-deco-rebinds-identifier.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator return value is rebound before static fields are run
77
template: class/standard/cls-decl.template
88
features: [decorators]

src/decorator/class-deco-returns-class.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator can return a new class
77
template: class/standard
88
features: [decorators]

src/decorator/class-deco-returns-function.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator can return a standard function
77
template: class/standard
88
features: [decorators]

src/decorator/class-deco-returns-proxy.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator can return a Proxy
77
template: class/standard
88
features: [decorators, Proxy]

src/decorator/class-deco-returns-subclass.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoclassdefinition
66
desc: Class decorator can return a new class
77
template: class/standard
88
features: [decorators]

src/decorator/class/error/cls-decl.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/statements/class/decorator/class/error/
66
name: class decorator evaluation error in class declaration
77
features: [class, decorators]
8-
esid: prod-MethodDefinition
8+
esid: prod-ClassDeclaration
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/class/error/cls-expr.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/expressions/class/decorator/class/error/
66
name: private method decorator evaluation error in class expression
77
features: [class, decorators, class-methods-private]
8-
esid: prod-MethodDefinition
8+
esid: prod-ClassExpression
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/class/standard/cls-decl.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/statements/class/decorator/class/
66
name: decorator usage in a class declaration
77
features: [class]
8-
esid: prod-FieldDefinition
8+
esid: prod-ClassDeclaration
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/class/standard/cls-expr.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/expressions/class/decorator/class/
66
name: decorator usage in a class expression
77
features: [class]
8-
esid: prod-FieldDefinition
8+
esid: prod-FieldExpression
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/class/with-super-class/cls-decl.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/statements/class/decorator/class/with-super-class/
66
name: decorator usage in a class declaration
77
features: [class]
8-
esid: prod-FieldDefinition
8+
esid: prod-ClassDeclaration
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/class/with-super-class/cls-expr.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path: language/expressions/class/decorator/class/with-super-class/
66
name: decorator usage in a class expression
77
features: [class]
8-
esid: prod-FieldDefinition
8+
esid: prod-ClassExpression
99
---*/
1010

1111
/*{ decorators }*/

src/decorator/decorator-order-application-field-and-accessor.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-runtime-semantics-classdefinitionevaluation
5+
esid: sec-ecmascript-function-objects-construct-argumentslist-newtarget
66
desc: Order of decorator application for elements with initializers
77
templates:
88
- accessors/with-init/**/*

src/decorator/decorator-order-phases-4-init-instance.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-runtime-semantics-classdefinitionevaluation
5+
esid: sec-ecmascript-function-objects-construct-argumentslist-newtarget
66
desc: Class instance creation order
77
info: |
88
Class instances are created in the following order:

src/decorator/field-init-this.case renamed to src/decorator/field-and-accessor-init-this.case

+9-3
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,23 @@
44
/*---
55
esid: sec-initializefieldoraccessor
66
desc: Field initializer `this` value is the instance or the class
7-
template: fields/with-init/**/*
7+
templates:
8+
- fields/standard/**/*
9+
- fields/with-init/**/*
10+
- accessors/standard/**/*
11+
- accessors/with-init/**/*
812
features: [decorators]
913
---*/
1014

1115
//- decorators
1216
var savedThisValues = [];
1317

14-
function dec(value) {
15-
return function(value) {
18+
function dec(value, context) {
19+
function init (value) {
1620
savedThisValues.push(this);
1721
}
22+
23+
return context.kind === 'field' ? init : { init };
1824
}
1925

2026
//- application

src/decorator/getter-deco-returns-invalid.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator can't return an invalid value
77
template: getters/error/**/*
88
features: [decorators]

src/decorator/getter-deco-returns-replacement.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Can replace a decorated getter with a new getter
77
template: getters/standard/**/*
88
features: [decorators]

src/decorator/getter-deco-returns-undefined.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator undefined return defaults to previous value
77
template: getters/standard/**/*
88
features: [decorators]

src/decorator/method-async-deco-returns-replacement.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Can replace a decorated method with a new method
77
template: methods/async/**/*
88
features: [decorators]

src/decorator/method-async-deco-returns-undefined.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator undefined return defaults to previous value
77
template: methods/async/**/*
88
features: [decorators]

src/decorator/method-deco-returns-invalid.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator can't return an invalid value
77
template: methods/error/**/*
88
features: [decorators]

src/decorator/method-deco-returns-replacement.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Can replace a decorated method with a new method
77
template: methods/standard/**/*
88
features: [decorators]

src/decorator/method-deco-returns-undefined.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator undefined return defaults to previous value
77
template: methods/standard/**/*
88
features: [decorators]

src/decorator/method-generator-deco-returns-replacement.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Can replace a decorated method with a new method
77
template: methods/generator/**/*
88
features: [decorators]

src/decorator/method-generator-deco-returns-undefined.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator undefined return defaults to previous value
77
template: methods/generator/**/*
88
features: [decorators]

src/decorator/setter-deco-returns-invalid.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator can't return an invalid value
77
template: setters/error/**/*
88
features: [decorators]

src/decorator/setter-deco-returns-replacement.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Can replace a decorated setter with a new setter
77
template: setters/standard/**/*
88
features: [decorators]

src/decorator/setter-deco-returns-undefined.case

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-createdecoratorcontextobject
5+
esid: sec-applydecoratorstoelementdefinition
66
desc: Decorator undefined return defaults to previous value
77
template: setters/standard/**/*
88
features: [decorators]

0 commit comments

Comments
 (0)