diff --git a/.gitignore b/.gitignore index 1203b32d2ea..bb6ea389254 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *~ *.pyc console/TestCases +.idea \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-construct.js b/test/built-ins/AsyncGenerator/AsyncGenerator-construct.js new file mode 100644 index 00000000000..7e52d6f9ac7 --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-construct.js @@ -0,0 +1,28 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + %AsyncGeneratorProrotype% creates functions with or without new and handles arguments + similarly to functions. +---*/ + +var AsyncGeneratorProrotype = async function* foo() { }.constructor; +var fn; + +fn = AsyncGeneratorProrotype("a", "await 1;"); +assert.sameValue(fn.length, 1, "length with 1 argument, call"); + +fn = AsyncGeneratorProrotype("a,b", "await 1;"); +assert.sameValue(fn.length, 2, "length with 2 arguments in one, call"); + +fn = AsyncGeneratorProrotype("a", "b", "await 1;"); +assert.sameValue(fn.length, 2, "length with 2 arguments, call"); + +fn = new AsyncGeneratorProrotype("a", "await 1;"); +assert.sameValue(fn.length, 1, "length with 1 argument, construct"); + +fn = new AsyncGeneratorProrotype("a,b", "await 1;"); +assert.sameValue(fn.length, 2, "length with 2 arguments in one, construct"); + +fn = new AsyncGeneratorProrotype("a", "b", "await 1;"); +assert.sameValue(fn.length, 2, "length with 2 arguments, construct"); diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-is-extensible.js b/test/built-ins/AsyncGenerator/AsyncGenerator-is-extensible.js new file mode 100644 index 00000000000..c8c1827ad3e --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-is-extensible.js @@ -0,0 +1,10 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + %AsyncGeneratorFunction% is extensible +---*/ + +var AsyncGeneratorFunction = async function*() { }.constructor; +AsyncGeneratorFunction.x = 1; +assert.sameValue(AsyncGeneratorFunction.x, 1); diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-is-subclass.js b/test/built-ins/AsyncGenerator/AsyncGenerator-is-subclass.js new file mode 100644 index 00000000000..a60da2aad15 --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-is-subclass.js @@ -0,0 +1,14 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + %AsyncGeneratorFunction% is a subclass of Function + (The AsyncGeneratorFunction constructor is a standard built-in + function object that inherits from the Function constructor. ) +---*/ +async function* foo() { }; +var AsyncGeneratorFunction = foo.constructor; +assert.sameValue(Object.getPrototypeOf(AsyncGeneratorFunction), Function, "Prototype of constructor is Function"); +assert.sameValue(Object.getPrototypeOf(AsyncGeneratorFunction.prototype), Function.prototype, "Prototype of constructor's prototype is Function.prototype"); +assert(foo instanceof Function, 'async generator instance is instanceof Function'); + diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-length.js b/test/built-ins/AsyncGenerator/AsyncGenerator-length.js new file mode 100644 index 00000000000..42aa73b41eb --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-length.js @@ -0,0 +1,13 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + %AsyncGeneratorFunction% has a length of 1 with writable false, enumerable false, configurable true. +includes: [propertyHelper.js] +---*/ + +var AsyncGeneratorFunction = async function* foo() { }.constructor; +assert.sameValue(AsyncGeneratorFunction.length, 1); +verifyNotWritable(AsyncGeneratorFunction, 'length'); +verifyNotEnumerable(AsyncGeneratorFunction, 'length'); +verifyConfigurable(AsyncGeneratorFunction, 'length'); diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-name.js b/test/built-ins/AsyncGenerator/AsyncGenerator-name.js new file mode 100644 index 00000000000..b21cfaa27a6 --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-name.js @@ -0,0 +1,15 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + The value of the name property of + the AsyncGeneratorFunction is "AsyncGeneratorFunction". +includes: [propertyHelper.js] +---*/ + +var AsyncGeneratorFunction = async function* foo() { }.constructor; +assert.sameValue(AsyncGeneratorFunction.name, "AsyncGeneratorFunction"); +verifyNotWritable(AsyncGeneratorFunctionAsyncFunction, "name"); +verifyNotEnumerable(AsyncGeneratorFunction, "name"); +verifyConfigurable(AsyncGeneratorFunction, "name"); + \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-next-callable.js b/test/built-ins/AsyncGenerator/AsyncGenerator-next-callable.js new file mode 100644 index 00000000000..1100f69cbb0 --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-next-callable.js @@ -0,0 +1,10 @@ +/*--- + author: Sasha Kruglyak + esid: pending + description: > + %AsyncGeneratorPrototype%.next.[[Call]] exists (is callable) + ---*/ + +async function* foo() { }; +assert.sameValue(foo.hasOwnProperty("next"), true); +foo().next(); \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator-prototype.js b/test/built-ins/AsyncGenerator/AsyncGenerator-prototype.js new file mode 100644 index 00000000000..c39408850b8 --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator-prototype.js @@ -0,0 +1,11 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: AsyncGeneratorFunction has a prototype property with writable false, enumerable false, configurable false. +includes: [propertyHelper.js] +---*/ + +var AsyncGeneratorFunction = async function* foo() { }.constructor; +verifyNotConfigurable(AsyncGeneratorFunction, 'prototype'); +verifyNotWritable(AsyncGeneratorFunction, 'prototype'); +verifyNotEnumerable(AsyncGeneratorFunctionAsyncFunction, 'prototype'); diff --git a/test/built-ins/AsyncGenerator/AsyncGenerator.js b/test/built-ins/AsyncGenerator/AsyncGenerator.js new file mode 100644 index 00000000000..80fc91a332a --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGenerator.js @@ -0,0 +1,8 @@ +/*--- +author: Benjamin Gruenbaum +description: > + %AsyncGeneratorPrototype% exists and is a function +---*/ + +var AsyncGeneratorFunction = async function* foo() { }.constructor; +assert.sameValue(typeof AsyncGeneratorFunction, "function"); diff --git a/test/built-ins/AsyncGenerator/AsyncGeneratorPrototye-constructor.js b/test/built-ins/AsyncGenerator/AsyncGeneratorPrototye-constructor.js new file mode 100644 index 00000000000..2b23da826fc --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGeneratorPrototye-constructor.js @@ -0,0 +1,14 @@ +/*--- +author: Sakthipriyan Vairamani (thefourtheye) +description: Check if %AsyncGeneratorFunction% function's `prototype` + object's `constructor` property is %AsyncGeneratorFunction% + itself +---*/ + +const AsyncGeneratorFunction = async function* () {}.constructor; +const AGFPrototype = AsyncGeneratorFunction.prototype; +assert.sameValue(AGFPrototype.constructor, AsyncGeneratorFunction); + +verifyNotEnumerable(AGFPrototype, 'constructor'); +verifyNotWritable(AGFPrototype, 'constructor'); +verifyConfigurable(AGFPrototype, 'constructor'); \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/AsyncGeneratorPrototype-is-extensible.js b/test/built-ins/AsyncGenerator/AsyncGeneratorPrototype-is-extensible.js new file mode 100644 index 00000000000..a30bb67447e --- /dev/null +++ b/test/built-ins/AsyncGenerator/AsyncGeneratorPrototype-is-extensible.js @@ -0,0 +1,11 @@ +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + %AsyncGeneratorPrototype% has a [[Extensible]] of true +---*/ + +var AsyncGeneratorFunction = async function* foo() { }.constructor; +AsyncGeneratorFunction.prototype.x = 1; +assert.sameValue(AsyncGeneratorFunction.prototype.x, 1); + diff --git a/test/built-ins/AsyncGenerator/exposed-via-constructor-property.js b/test/built-ins/AsyncGenerator/exposed-via-constructor-property.js new file mode 100644 index 00000000000..4ca32f6753b --- /dev/null +++ b/test/built-ins/AsyncGenerator/exposed-via-constructor-property.js @@ -0,0 +1,8 @@ +/*--- +author: Sakthipriyan Vairamani (thefourtheye) +description: Make sure %AsyncGeneratorFunction% is exposed via the + `.constructor` property. +---*/ + +const AsyncGeneratorFunction = async function* () {}.constructor; +assert.sameValue(typeof AsyncGeneratorFunction, 'function'); \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/is-not-a-global.js b/test/built-ins/AsyncGenerator/is-not-a-global.js new file mode 100644 index 00000000000..99ef5fda89a --- /dev/null +++ b/test/built-ins/AsyncGenerator/is-not-a-global.js @@ -0,0 +1,8 @@ +/*--- +author: Sakthipriyan Vairamani (thefourtheye) +description: Make sure %AsyncGeneratorFunction% is not a global function +---*/ + +assert.throws(ReferenceError, function() { + AsyncGeneratorFunction +}, 'AsyncGeneratorFunction should not be available in global scope'); \ No newline at end of file diff --git a/test/built-ins/AsyncGenerator/prototype-property-toStringTag.js b/test/built-ins/AsyncGenerator/prototype-property-toStringTag.js new file mode 100644 index 00000000000..a1bb7a0adb8 --- /dev/null +++ b/test/built-ins/AsyncGenerator/prototype-property-toStringTag.js @@ -0,0 +1,15 @@ +/*--- +author: Sakthipriyan Vairamani (thefourtheye) +description: Check if %AsyncGeneratorFunction% function's `prototype` + object's `Symbol.toStringTag` property is + 'AsyncGeneratorFunction' +---*/ + +const AsyncGeneratorFunction = async function* () {}.constructor; +const AGFPrototype = AsyncGeneratorFunction.prototype; + +assert.sameValue(AGFPrototype[Symbol.toStringTag], 'AsyncGeneratorFunction'); + +verifyNotEnumerable(AGFPrototype, Symbol.toStringTag); +verifyNotWritable(AGFPrototype, Symbol.toStringTag); +verifyConfigurable(AGFPrototype, Symbol.toStringTag); \ No newline at end of file diff --git a/test/built-ins/Symbol/asyncIterator/cross-realm.js b/test/built-ins/Symbol/asyncIterator/cross-realm.js new file mode 100644 index 00000000000..ceccf50f9a9 --- /dev/null +++ b/test/built-ins/Symbol/asyncIterator/cross-realm.js @@ -0,0 +1,15 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +author: Benjamin Gruenbaum +esid: early +description: Value shared by all realms +info: > + Unless otherwise specified, well-known symbols values are shared by all + realms. +features: [Symbol.asyncIterator] +---*/ + +var otherRealmSymbol = $.createRealm().global.Symbol; + +assert.sameValue(Symbol.asyncIterator, otherRealmSymbol.asyncIterator); diff --git a/test/built-ins/Symbol/asyncIterator/name-prop.js b/test/built-ins/Symbol/asyncIterator/name-prop.js new file mode 100644 index 00000000000..f8e3ba29916 --- /dev/null +++ b/test/built-ins/Symbol/asyncIterator/name-prop.js @@ -0,0 +1,11 @@ +/*--- +author: Benjamin Gruenbaum +esid: early +description: Name prop of Symbol.asyncIterator +info: > + The value of the name property of this function is "[Symbol.asyncIterator]". +features: [Symbol.asyncIterator] +---*/ + + +assert.sameValue(Symbol.asyncIterator.name, '[Symbol.asyncIterator]'); diff --git a/test/built-ins/Symbol/asyncIterator/prop-desc.js b/test/built-ins/Symbol/asyncIterator/prop-desc.js new file mode 100644 index 00000000000..4da5fce2aae --- /dev/null +++ b/test/built-ins/Symbol/asyncIterator/prop-desc.js @@ -0,0 +1,17 @@ +// Copyright (C) 2015-2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: early +description: > + `Symbol.asyncIterator` property descriptor +info: > + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: false }. +includes: [propertyHelper.js] +features: [Symbol.asyncIterator] +---*/ + +assert.sameValue(typeof Symbol.asyncIterator, 'symbol'); +verifyNotEnumerable(Symbol, 'asyncIterator'); +verifyNotWritable(Symbol, 'asyncIterator'); +verifyNotConfigurable(Symbol, 'asyncIterator'); diff --git a/test/language/expressions/async-generators/early-errors-expression-NSPL-with-USD.js b/test/language/expressions/async-generators/early-errors-expression-NSPL-with-USD.js new file mode 100644 index 00000000000..b887c2ce270 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-NSPL-with-USD.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and + IsSimpleParameterList of UniqueFormalParameters is false. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(x = 1) {"use strict"}); diff --git a/test/language/expressions/async-generators/early-errors-expression-arguments-in-formal-parameters.js b/test/language/expressions/async-generators/early-errors-expression-arguments-in-formal-parameters.js new file mode 100644 index 00000000000..69e5026b854 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-arguments-in-formal-parameters.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a SyntaxError if FormalParameters contains arguments in strict mode. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +(async function*(arguments) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-await-as-function-binding-identifier.js b/test/language/expressions/async-generators/early-errors-expression-await-as-function-binding-identifier.js new file mode 100644 index 00000000000..0b02630356d --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-await-as-function-binding-identifier.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1.1 +description: > + `await` is not a valid BindingIdentifier for AsyncGeneratorExpressions. +negative: + phase: early + type: SyntaxError +---*/ + +(async function* await() { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-binding-identifier-arguments.js b/test/language/expressions/async-generators/early-errors-expression-binding-identifier-arguments.js new file mode 100644 index 00000000000..85617538a4e --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-binding-identifier-arguments.js @@ -0,0 +1,16 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + If the source code matching this production is strict code, it is a + Syntax Error if BindingIdentifier is the IdentifierName arguments. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +(async function* arguments() { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-binding-identifier-eval.js b/test/language/expressions/async-generators/early-errors-expression-binding-identifier-eval.js new file mode 100644 index 00000000000..79474a644f8 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-binding-identifier-eval.js @@ -0,0 +1,16 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + If the source code matching this production is strict code, it is a + Syntax Error if BindingIdentifier is the IdentifierName eval. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +(async function* eval() { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-body-contains-super-call.js b/test/language/expressions/async-generators/early-errors-expression-body-contains-super-call.js new file mode 100644 index 00000000000..bca6ed5d716 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-body-contains-super-call.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a syntax error if AsyncGeneratorBody contains SuperCall is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*() { super(); }); diff --git a/test/language/expressions/async-generators/early-errors-expression-body-contains-super-property.js b/test/language/expressions/async-generators/early-errors-expression-body-contains-super-property.js new file mode 100644 index 00000000000..794125f52e4 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-body-contains-super-property.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a syntax error if AsyncGeneratorBody contains SuperProperty is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*() { super.prop; }); diff --git a/test/language/expressions/async-generators/early-errors-expression-eval-in-formal-parameters.js b/test/language/expressions/async-generators/early-errors-expression-eval-in-formal-parameters.js new file mode 100644 index 00000000000..c87c23b6770 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-eval-in-formal-parameters.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a SyntaxError if FormalParameters contains eval in strict mode. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +(async function*(eval) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-const.js b/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-const.js new file mode 100644 index 00000000000..53e3a2365a6 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-const.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a SyntaxError if BoundNames of FormalParameters also occurs in the + LexicallyDeclaredNames of AsyncFunctionBody +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(a) { const a = 0; }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-let.js b/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-let.js new file mode 100644 index 00000000000..593d4325d53 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-body-duplicate-let.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a SyntaxError if BoundNames of FormalParameters also occurs in the + LexicallyDeclaredNames of AsyncFunctionBody +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(a) { let a; }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-await-expr.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-await-expr.js new file mode 100644 index 00000000000..1c94b75fc2a --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-await-expr.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a Syntax Error if FormalParameters Contains AwaitExpression is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(x = await 1) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-await.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-await.js new file mode 100644 index 00000000000..bd038d0fe23 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-await.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1 +description: > + `await` is a reserved keyword within async generator function bodies and may + not be used as the binding identifier of a parameter. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(await) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-call.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-call.js new file mode 100644 index 00000000000..c25c59d2b81 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-call.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a syntax error if FormalParameters contains SuperCall is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(a = super()) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-property.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-property.js new file mode 100644 index 00000000000..a162eb58ec5 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-super-property.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a syntax error if FormalParameters contains SuperProperty is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(a = super.prop { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield-expr.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield-expr.js new file mode 100644 index 00000000000..828f5a57ef7 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield-expr.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + It is a Syntax Error if FormalParameters Contains YieldExpression is true. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(x = yield) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield.js b/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield.js new file mode 100644 index 00000000000..cbc96a88360 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-formals-contains-yield.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1 +description: > + `await` is a reserved keyword within async generator function bodies and may + not be used as the binding identifier of a parameter. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*(yield) { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-label-name-await.js b/test/language/expressions/async-generators/early-errors-expression-label-name-await.js new file mode 100644 index 00000000000..050f8961541 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-label-name-await.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1.1 +description: > + `await` is a reserved keyword within async generator function bodies and may + not be used as a label. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*() { + await: 1; +}); diff --git a/test/language/expressions/async-generators/early-errors-expression-label-name-yield.js b/test/language/expressions/async-generators/early-errors-expression-label-name-yield.js new file mode 100644 index 00000000000..453e33b1b64 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-label-name-yield.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1.1 +description: > + `yield` is a reserved keyword within async generator function bodies and may + not be used as a label. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*() { + yield: 1; +}); diff --git a/test/language/expressions/async-generators/early-errors-expression-not-simple-assignment-target.js b/test/language/expressions/async-generators/early-errors-expression-not-simple-assignment-target.js new file mode 100644 index 00000000000..900b8277e1c --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-not-simple-assignment-target.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: pending +description: > + Async generator function expressions are not a simple assignment target. +negative: + phase: early + type: ReferenceError +---*/ + +(async function*() { } = 1); diff --git a/test/language/expressions/async-generators/early-errors-expression-parameter-yield.js b/test/language/expressions/async-generators/early-errors-expression-parameter-yield.js new file mode 100644 index 00000000000..a2bef65f952 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-parameter-yield.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + throw a SyntaxError if UniqueFormalParameters contains yield (invalid BindingIdentifier): +negative: + phase: early + type: SyntaxError +---*/ + +(async function* (yield) {}); \ No newline at end of file diff --git a/test/language/expressions/async-generators/early-errors-expression-yield-as-function-binding-identifier.js b/test/language/expressions/async-generators/early-errors-expression-yield-as-function-binding-identifier.js new file mode 100644 index 00000000000..ec54ee71828 --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-yield-as-function-binding-identifier.js @@ -0,0 +1,14 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 12.1.1 +description: > + `yield` is not a valid BindingIdentifier for AsyncGeneratorExpressions. +negative: + phase: early + type: SyntaxError +---*/ + +(async function* yield() { }); diff --git a/test/language/expressions/async-generators/early-errors-expression-yield-star-after-newline.js b/test/language/expressions/async-generators/early-errors-expression-yield-star-after-newline.js new file mode 100644 index 00000000000..2d2c83ab07a --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-expression-yield-star-after-newline.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + A newline may not precede the `*` token in a `yield` expression. +negative: + phase: early + type: SyntaxError +---*/ + +(async function*() { + yield + * 1; +}); diff --git a/test/language/expressions/async-generators/early-errors-next-receiver-not-async-iterator.js b/test/language/expressions/async-generators/early-errors-next-receiver-not-async-iterator.js new file mode 100644 index 00000000000..542b6b2993a --- /dev/null +++ b/test/language/expressions/async-generators/early-errors-next-receiver-not-async-iterator.js @@ -0,0 +1,15 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Benjamin Gruenbaum +esid: pending +description: > + next() rejects with a TypeError when receiver is not an AsyncGenerator instance: +---*/ + +(async function*() {})().next.call((function*() {})()).then(function() { + throw new Test262Error("should not have resolved"); +}, function(err) { + assert(err instanceof TypeError); +}).then($DONE, $DONE); \ No newline at end of file diff --git a/test/language/expressions/async-generators/expression-await-as-yield-operand.js b/test/language/expressions/async-generators/expression-await-as-yield-operand.js new file mode 100644 index 00000000000..cad8157bb7d --- /dev/null +++ b/test/language/expressions/async-generators/expression-await-as-yield-operand.js @@ -0,0 +1,24 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + AwaitExpressions are valid operands to yield expressions. +flags: [async] +---*/ + +var iter = (async function*() { + yield await "a"; +})(); + +iter.next().then(function(result) { + assert.sameValue(result.value, "a", 'First result `value`'); + assert.sameValue(result.done, false, 'First result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Second result `value`'); + assert.sameValue(result.done, true, 'Second result `done` flag'); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-await-promise-as-yield-operand.js b/test/language/expressions/async-generators/expression-await-promise-as-yield-operand.js new file mode 100644 index 00000000000..8f345472be7 --- /dev/null +++ b/test/language/expressions/async-generators/expression-await-promise-as-yield-operand.js @@ -0,0 +1,26 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + AwaitExpressions are valid operands to yield expressions. +flags: [async] +---*/ + +var iter = (async function*() { + yield await new Promise(function(resolve) { + resolve("a"); + }); +})(); + +iter.next().then(function(result) { + assert.sameValue(result.value, "a", 'First result `value`'); + assert.sameValue(result.done, false, 'First result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Second result `value`'); + assert.sameValue(result.done, true, 'Second result `done` flag'); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-await-thenable-as-yield-operand.js b/test/language/expressions/async-generators/expression-await-thenable-as-yield-operand.js new file mode 100644 index 00000000000..c436a94172a --- /dev/null +++ b/test/language/expressions/async-generators/expression-await-thenable-as-yield-operand.js @@ -0,0 +1,30 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + AwaitExpressions are valid operands to yield expressions. +flags: [async] +---*/ + +var thenable = { + then: function(resolve, reject) { + resolve("a"); + } +}; + +var iter = (async function*() { + yield await thenable; +})(); + +iter.next().then(function(result) { + assert.sameValue(result.value, "a", 'First result `value`'); + assert.sameValue(result.done, false, 'First result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Second result `value`'); + assert.sameValue(result.done, true, 'Second result `done` flag'); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-yield-as-operand.js b/test/language/expressions/async-generators/expression-yield-as-operand.js new file mode 100644 index 00000000000..c2a14ffcd38 --- /dev/null +++ b/test/language/expressions/async-generators/expression-yield-as-operand.js @@ -0,0 +1,31 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + `yield` expressions may be used as the right-hand-side of other `yield` + expressions. +flags: [async] +---*/ + +var g = async function*() { + yield yield 1; +}; + +var iter = g(); +iter.next().then(function(result) { + assert.sameValue(result.value, 1, 'First result `value`'); + assert.sameValue(result.done, false, 'First result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Second result `value`'); + assert.sameValue(result.done, false, 'Second result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Third result `value`'); + assert.sameValue(result.done, true, 'Thid result `done` flag'); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-yield-as-statement.js b/test/language/expressions/async-generators/expression-yield-as-statement.js new file mode 100644 index 00000000000..9647c0bb397 --- /dev/null +++ b/test/language/expressions/async-generators/expression-yield-as-statement.js @@ -0,0 +1,41 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + `yield` is a valid statement within async generator function bodies. +flags: [async] +---*/ + +var g1 = async function*() { yield; }; +var g2 = async function*() { yield 1; }; + +var iter1 = g1(); +iter1.next().then(function(result) { + assert.sameValue( + result.value, undefined, "Without right-hand-side: first result `value`"); + assert.sameValue( + result.done, false, "Without right-hand-side: first result `done` flag"); +}).then(undefined, $DONE); +iter1.next(function(result) { + assert.sameValue( + result.value, undefined, "Without right-hand-side: second result `value`"); + assert.sameValue( + result.done, true, "Without right-hand-side: second result `done` flag"); +}).then(undefined, $DONE); + +var iter2 = g2(); +iter2.next().then(function(result) { + assert.sameValue( + result.value, 1, "With right-hand-side: first result `value`"); + assert.sameValue( + result.done, false, "With right-hand-side: first result `done` flag"); +}).then(undefined, $DONE); +iter2.next(function(result) { + assert.sameValue( + result.value, undefined, "With right-hand-side: second result `value`"); + assert.sameValue( + result.done, true, "With right-hand-side: second result `done` flag"); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-yield-newline.js b/test/language/expressions/async-generators/expression-yield-newline.js new file mode 100644 index 00000000000..3b183a2b6b4 --- /dev/null +++ b/test/language/expressions/async-generators/expression-yield-newline.js @@ -0,0 +1,26 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + Newlines terminate `yield` expressions. +flags: [async] +---*/ + +var g = async function*() { + yield + 1; +}; + +var iter = g(); +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'First result `value`'); + assert.sameValue(result.done, false, 'First result `done` flag'); +}).then(undefined, $DONE); + +iter.next().then(function(result) { + assert.sameValue(result.value, undefined, 'Second result `value`'); + assert.sameValue(result.done, true, 'Second result `done` flag'); +}).then($DONE, $DONE); diff --git a/test/language/expressions/async-generators/expression-yield-star-before-newline.js b/test/language/expressions/async-generators/expression-yield-star-before-newline.js new file mode 100644 index 00000000000..d22ef2f88f8 --- /dev/null +++ b/test/language/expressions/async-generators/expression-yield-star-before-newline.js @@ -0,0 +1,20 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +author: Caitlin Potter +esid: 14.4 +description: > + The right-hand side of a `yield *` expression may appear on a new line. +flags: [async] +---*/ + +var g = async function*() {}; + +(async function*() { + yield* + g(); +})().next().then(function(result) { + assert.sameValue(result.value, undefined); + assert.sameValue(result.done, true); +}).then($DONE, $DONE); diff --git a/test/language/statements/async-function/early-error-declaration-parameters-contains-yield-nested-async-function-expression.js b/test/language/statements/async-function/early-error-declaration-parameters-contains-yield-nested-async-function-expression.js new file mode 100644 index 00000000000..d9d8fa33cf1 --- /dev/null +++ b/test/language/statements/async-function/early-error-declaration-parameters-contains-yield-nested-async-function-expression.js @@ -0,0 +1,16 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if BindingIdentifier is "yield" + and function is nested inside AsyncFunctionExpression + negative: + phase: early + type: SyntaxError + ---*/ + +async function() { + async function* foo (yield) { } +} \ No newline at end of file diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-await-expression.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-await-expression.js new file mode 100644 index 00000000000..986f3c784ca --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-await-expression.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains AwaitExpression + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (await 1) { } diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-await.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-await.js new file mode 100644 index 00000000000..099b921770a --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-await.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains await + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (await) { } diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-call.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-call.js new file mode 100644 index 00000000000..4180ebbb484 --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-call.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains SuperCall + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (super()) { } diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-property.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-property.js new file mode 100644 index 00000000000..d864a6c4246 --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-super-property.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains SuperProperty + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (super) { } diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-declaration.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-declaration.js new file mode 100644 index 00000000000..bb1acc2b548 --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-declaration.js @@ -0,0 +1,18 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if BindingIdentifier is "yield" + and function is nested inside GeneratorDeclaration + negative: + phase: early + type: SyntaxError + ---*/ + +function* boo() { + async function* foo (yield) { } +} + + diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-expression.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-expression.js new file mode 100644 index 00000000000..dcb4f17ab8b --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-expression.js @@ -0,0 +1,16 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if BindingIdentifier is "yield" + and function is nested inside GeneratorExpression + negative: + phase: early + type: SyntaxError + ---*/ + +function*() { + async function* foo (yield) { } +} \ No newline at end of file diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-method.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-method.js new file mode 100644 index 00000000000..bbd84041775 --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield-nested-generator-method.js @@ -0,0 +1,18 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if BindingIdentifier is "yield" + and function is nested inside GeneratorMethod + negative: + phase: early + type: SyntaxError + ---*/ + +class A { + *boo() { + async function* foo (yield) { } + } +} \ No newline at end of file diff --git a/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield.js b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield.js new file mode 100644 index 00000000000..d3143c1a5b6 --- /dev/null +++ b/test/language/statements/async-generator/early-error-declaration-parameters-contains-yield.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains yield + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (yield) { } diff --git a/test/language/statements/async-generator/early-errors-decalaration-body-contains-super-property.js b/test/language/statements/async-generator/early-errors-decalaration-body-contains-super-property.js new file mode 100644 index 00000000000..065108573ac --- /dev/null +++ b/test/language/statements/async-generator/early-errors-decalaration-body-contains-super-property.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if AsyncGeneratorBody contains SuperProperty + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo () { super.prop; } diff --git a/test/language/statements/async-generator/early-errors-declaration-body-contains-super-call.js b/test/language/statements/async-generator/early-errors-declaration-body-contains-super-call.js new file mode 100644 index 00000000000..ef9fe5f158d --- /dev/null +++ b/test/language/statements/async-generator/early-errors-declaration-body-contains-super-call.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if AsyncGeneratorBody contains SuperCall + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo () { super(); } diff --git a/test/language/statements/async-generator/early-errors-declaration-parameters-contains-yield-expression.js b/test/language/statements/async-generator/early-errors-declaration-parameters-contains-yield-expression.js new file mode 100644 index 00000000000..76b08b42e72 --- /dev/null +++ b/test/language/statements/async-generator/early-errors-declaration-parameters-contains-yield-expression.js @@ -0,0 +1,13 @@ +// Copyright 2016 Microsoft, Inc. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- + author: Sasha Kruglyak + esid: pending + description: It is a syntax error if FormalParameters contains YieldExpression + negative: + phase: early + type: SyntaxError + ---*/ + +async function* foo (yield) { } diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-await-expression-in-params.js b/test/language/statements/class/definition/early-errors-methods-async-generators-await-expression-in-params.js new file mode 100644 index 00000000000..2988d636159 --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-await-expression-in-params.js @@ -0,0 +1,12 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + Throws a Syntax Error if UniqueFormalParameters contains AwaitExpression +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(await 1){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-await-in-params.js b/test/language/statements/class/definition/early-errors-methods-async-generators-await-in-params.js new file mode 100644 index 00000000000..f921769939b --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-await-in-params.js @@ -0,0 +1,13 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + AsyncGeneratorMethod throw a SyntaxError if UniqueFormalParameters + contains await (invalid BindingIdentifier) +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(await){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-duplicate-entries-params.js b/test/language/statements/class/definition/early-errors-methods-async-generators-duplicate-entries-params.js new file mode 100644 index 00000000000..32f9aa9651f --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-duplicate-entries-params.js @@ -0,0 +1,12 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + AsyncGeneratorMethod throw a SyntaxError if UniqueFormalParameters contains duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(param,param){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-body.js b/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-body.js new file mode 100644 index 00000000000..05124bcbaa8 --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-body.js @@ -0,0 +1,13 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + Throws a Syntax Error if HasDirectSuper of AsyncGeneratorMethod is true, + in function body +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(){super();} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-param.js b/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-param.js new file mode 100644 index 00000000000..9fa932d763c --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-super-call-param.js @@ -0,0 +1,13 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + Throws a Syntax Error if HasDirectSuper of AsyncGeneratorMethod is true, + in UniqueFormalParameters +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(x = super()){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-yield-expression-in-params.js b/test/language/statements/class/definition/early-errors-methods-async-generators-yield-expression-in-params.js new file mode 100644 index 00000000000..44e7785d03c --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-yield-expression-in-params.js @@ -0,0 +1,12 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + Throws a Syntax Error if UniqueFormalParameters contains YieldExpression +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(yield 1){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/early-errors-methods-async-generators-yield-in-params.js b/test/language/statements/class/definition/early-errors-methods-async-generators-yield-in-params.js new file mode 100644 index 00000000000..4386a948163 --- /dev/null +++ b/test/language/statements/class/definition/early-errors-methods-async-generators-yield-in-params.js @@ -0,0 +1,13 @@ +/*--- +author: Nitzan Uziely +esid: pending +description: > + AsyncGeneratorMethod throw a SyntaxError if UniqueFormalParameters + contains yield (invalid BindingIdentifier) +negative: + phase: early + type: SyntaxError +---*/ +class A { + async function* method(yield){} +} \ No newline at end of file diff --git a/test/language/statements/class/definition/methods-async-super-call-body.js b/test/language/statements/class/definition/early-errors-methods-async-super-call-body.js similarity index 100% rename from test/language/statements/class/definition/methods-async-super-call-body.js rename to test/language/statements/class/definition/early-errors-methods-async-super-call-body.js diff --git a/test/language/statements/class/definition/methods-async-super-call-param.js b/test/language/statements/class/definition/early-errors-methods-async-super-call-param.js similarity index 100% rename from test/language/statements/class/definition/methods-async-super-call-param.js rename to test/language/statements/class/definition/early-errors-methods-async-super-call-param.js