-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add %GeneratorFunction.prototype% test
- Loading branch information
1 parent
fd91dd1
commit e0a65ee
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
test/built-ins/GeneratorFunction/prototype/not-callable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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"); |