diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/GeneratorFunction/prototype')
8 files changed, 143 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/Symbol.toStringTag.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/Symbol.toStringTag.js new file mode 100644 index 0000000000..d8094e51af --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/Symbol.toStringTag.js @@ -0,0 +1,28 @@ +// Copyright (C) 2013 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + `Symbol.toStringTag` property descriptor +info: | + The initial value of the @@toStringTag property is the String value + "GeneratorFunction". + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: true }. +es6id: 25.2.3.3 +includes: [propertyHelper.js] +features: [generators, Symbol.toStringTag] +---*/ + +var GeneratorFunctionPrototype = Object.getPrototypeOf(function*() {}); + +assert.sameValue( + GeneratorFunctionPrototype[Symbol.toStringTag], 'GeneratorFunction' +); + +verifyNotEnumerable(GeneratorFunctionPrototype, Symbol.toStringTag); +verifyNotWritable(GeneratorFunctionPrototype, Symbol.toStringTag); +verifyConfigurable(GeneratorFunctionPrototype, Symbol.toStringTag); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/browser.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/browser.js diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/constructor.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/constructor.js new file mode 100644 index 0000000000..2166e3dce1 --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-generatorfunction.prototype.constructor +description: > + `constructor` property of the GeneratorFunction.prototype object +info: | + The initial value of GeneratorFunction.prototype.constructor is the intrinsic + object %GeneratorFunction%. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [generators] +---*/ + +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; + +assert.sameValue(GeneratorFunction.prototype.constructor, GeneratorFunction); + +verifyNotEnumerable(GeneratorFunction.prototype, 'constructor'); +verifyNotWritable(GeneratorFunction.prototype, 'constructor'); +verifyConfigurable(GeneratorFunction.prototype, 'constructor'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/extensibility.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/extensibility.js new file mode 100644 index 0000000000..dd1d470f02 --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/extensibility.js @@ -0,0 +1,16 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-properties-of-the-generatorfunction-prototype-object +description: Object extensibility +info: | + The initial value of the [[Extensible]] internal slot of the + GeneratorFunction prototype object is true. +features: [generators] +---*/ + +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; + +assert(Object.isExtensible(GeneratorFunction.prototype)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/not-callable.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/not-callable.js new file mode 100644 index 0000000000..2c7aac58ca --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/not-callable.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-generatorfunction-prototype-object +description: > + %GeneratorFunction.prototype% is an ordinary non-callable object. +info: | + Properties of the GeneratorFunction Prototype Object + + The GeneratorFunction prototype object: + + [...] + * is an ordinary object. + * is not a function object and does not have an [[ECMAScriptCode]] internal slot + or any other of the internal slots listed in Table 28 or Table 74. +features: [generators] +---*/ + +var GeneratorFunctionPrototype = Object.getPrototypeOf(function* () {}); + +assert.sameValue(typeof GeneratorFunctionPrototype, "object"); +assert.throws(TypeError, function() { + GeneratorFunctionPrototype(); +}); + +assert(!GeneratorFunctionPrototype.hasOwnProperty("length"), "length"); +assert(!GeneratorFunctionPrototype.hasOwnProperty("name"), "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prop-desc.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prop-desc.js new file mode 100644 index 0000000000..5be780399b --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prop-desc.js @@ -0,0 +1,19 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 25.4.5.1 +description: GeneratorFunction.prototype property descriptor +info: | + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: false }. +includes: [propertyHelper.js] +features: [generators] +---*/ + +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; + +verifyNotEnumerable(GeneratorFunction, 'prototype'); +verifyNotWritable(GeneratorFunction, 'prototype'); +verifyNotConfigurable(GeneratorFunction, 'prototype'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prototype.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prototype.js new file mode 100644 index 0000000000..66b18eb458 --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/prototype.js @@ -0,0 +1,25 @@ +// Copyright (C) 2013 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 25.2.3.2 +description: > + The value of GeneratorFunction.prototype.prototype is the + %GeneratorPrototype% intrinsic object. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: + false, [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [generators] +---*/ + +var GeneratorFunctionPrototype = Object.getPrototypeOf(function*() {}); +assert.sameValue( + GeneratorFunctionPrototype.prototype, + Object.getPrototypeOf(function*() {}.prototype) +); + +verifyNotEnumerable(GeneratorFunctionPrototype, 'prototype'); +verifyNotWritable(GeneratorFunctionPrototype, 'prototype'); +verifyConfigurable(GeneratorFunctionPrototype, 'prototype'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/GeneratorFunction/prototype/shell.js b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/GeneratorFunction/prototype/shell.js |