aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorValerie R Young <valerie@bocoup.com>2018-02-12 14:12:16 -0500
committerLeo Balter <leonardo.balter@gmail.com>2018-02-15 10:45:13 -0500
commit510d6b7f44e96e452bc26ce603542d9b2b5592dc (patch)
tree772620503c6c869fbc9de84ee809d7ad07edea34 /test
parenta19993e2691b2420dade202db26e022e44436a86 (diff)
async-iteration: add tests for AsyncGenerationFunction
Diffstat (limited to 'test')
-rw-r--r--test/built-ins/AsyncGeneratorFunction/extensibility.js14
-rw-r--r--test/built-ins/AsyncGeneratorFunction/has-instance.js34
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-await-expr-in-param.js42
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-construct-throws.js31
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-length.js45
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-name.js28
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-prototype.js37
-rw-r--r--test/built-ins/AsyncGeneratorFunction/instance-yield-expr-in-param.js42
-rw-r--r--test/built-ins/AsyncGeneratorFunction/invoked-as-constructor-no-arguments.js20
-rw-r--r--test/built-ins/AsyncGeneratorFunction/invoked-as-function-multiple-arguments.js26
-rw-r--r--test/built-ins/AsyncGeneratorFunction/invoked-as-function-no-arguments.js19
-rw-r--r--test/built-ins/AsyncGeneratorFunction/invoked-as-function-single-argument.js28
-rw-r--r--test/built-ins/AsyncGeneratorFunction/length.js19
-rw-r--r--test/built-ins/AsyncGeneratorFunction/name.js29
-rw-r--r--test/built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js25
-rw-r--r--test/built-ins/AsyncGeneratorFunction/prototype/constructor.js25
-rw-r--r--test/built-ins/AsyncGeneratorFunction/prototype/extensibility.js14
-rw-r--r--test/built-ins/AsyncGeneratorFunction/prototype/prop-desc.js19
-rw-r--r--test/built-ins/AsyncGeneratorFunction/prototype/prototype.js26
19 files changed, 523 insertions, 0 deletions
diff --git a/test/built-ins/AsyncGeneratorFunction/extensibility.js b/test/built-ins/AsyncGeneratorFunction/extensibility.js
new file mode 100644
index 000000000..e0d2517d0
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/extensibility.js
@@ -0,0 +1,14 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-asyncgeneratorfunction
+description: Object extensibility
+info: |
+ The value of the [[Extensible]] internal slot of the AsyncGeneratorFunction
+ constructor is true.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+assert(Object.isExtensible(AsyncGeneratorFunction));
diff --git a/test/built-ins/AsyncGeneratorFunction/has-instance.js b/test/built-ins/AsyncGeneratorFunction/has-instance.js
new file mode 100644
index 000000000..ab9388b41
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/has-instance.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-asyncgeneratorfunction
+description: >
+ AsyncGenerator function instances are correctly reported as instances of the
+ AsyncGeneratorFunction intrinsic.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+async function* agDecl() {}
+var agExpr = async function* () {};
+
+assert(
+ agDecl instanceof AsyncGeneratorFunction,
+ 'AsyncGenerators created via AsyncGeneratorDeclaration syntax are proper instances of AsyncGeneratorFunction'
+);
+
+assert(
+ agExpr instanceof AsyncGeneratorFunction,
+ 'AsyncGenerators created via AsyncGeneratorExpression syntax are proper instances of AsyncGeneratorFunction'
+);
+
+assert(
+ new AsyncGeneratorFunction() instanceof AsyncGeneratorFunction,
+ 'AsyncGenerators created via constructor invocation of AsyncGeneratorFunction are proper instances of AsyncGeneratorFunction'
+);
+
+assert(
+ AsyncGeneratorFunction() instanceof AsyncGeneratorFunction,
+ 'AsyncGenerators created via function invocation of AsyncGeneratorFunction are proper instances of AsyncGeneratorFunction'
+);
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-await-expr-in-param.js b/test/built-ins/AsyncGeneratorFunction/instance-await-expr-in-param.js
new file mode 100644
index 000000000..460f554a6
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-await-expr-in-param.js
@@ -0,0 +1,42 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: Definition of instance `length` property
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ Runtime Semantics: CreateDynamicFunction
+ ...
+ 29. If kind is "async" or "async generator", then
+ a. If parameters Contains AwaitExpression is true, throw a SyntaxError
+ exception.
+features: [async-iteration]
+flags: [async]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+// AwaitExpression is permitted in function body.
+AsyncGeneratorFunction('x = await 42');
+
+assert.throws(SyntaxError, function() {
+ AsyncGeneratorFunction('x = await 42', '');
+}, 'AwaitExpression not permitted in parameters');
+
+var withinAsyncGenerator = async function*() {
+ AsyncGeneratorFunction('x = await 42', '');
+};
+
+withinAsyncGenerator().next().then(
+ function () {
+ throw new Test262Error("AwaitExpression not permitted when calling context is a async generator");
+ },
+ function (e) {
+ if (!(e instanceof SyntaxError)) {
+ throw new Test262Error("Expected SyntaxError but got " + e);
+ }
+ }
+).then($DONE, $DONE);
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-construct-throws.js b/test/built-ins/AsyncGeneratorFunction/instance-construct-throws.js
new file mode 100644
index 000000000..eba1a5f31
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-construct-throws.js
@@ -0,0 +1,31 @@
+// Copyright 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-asyncgeneratorfunction
+description: The instance created by AsyncGeneratorFunction is not a constructor
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return ? CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ Runtime Semantics: CreateDynamicFunction( constructor, newTarget, kind, args )
+ ...
+ 32. Let F be FunctionAllocate(proto, strict, kind).
+ ...
+
+ FunctionAllocate ( functionPrototype, strict, functionKind )
+ // [[Construct]] and [[ConstructKind]] are not set for functionKind="async generators"
+
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var instance = AsyncGeneratorFunction();
+
+assert.throws(TypeError, function() {
+ new instance();
+})
+
+
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-length.js b/test/built-ins/AsyncGeneratorFunction/instance-length.js
new file mode 100644
index 000000000..a7ea763f8
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-length.js
@@ -0,0 +1,45 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: Definition of instance `length` property
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ Runtime Semantics: CreateDynamicFunction
+ ...
+ // the parameter "args" is sliced into "parameters" and "body"
+ 26. Perform FunctionInitialize(F, Normal, parameters, body, scope).
+ ...
+
+ FunctionInitialize
+ ...
+ 2. Let len be the ExpectedArgumentCount of ParameterList.
+ 3. Perform ! DefinePropertyOrThrow(F, "length",
+ PropertyDescriptor{[[Value]]: len, [[Writable]]: false, [[Enumerable]]:
+ false, [[Configurable]]: true}).
+ ...
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var instance = AsyncGeneratorFunction()
+
+verifyProperty(AsyncGeneratorFunction(), "length", {
+ value: 0,
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
+
+assert.sameValue(AsyncGeneratorFunction('').length, 0, "test 1");
+assert.sameValue(AsyncGeneratorFunction('x').length, 0, "test 2");
+assert.sameValue(AsyncGeneratorFunction('x', '').length, 1, "test 3");
+assert.sameValue(AsyncGeneratorFunction('x', 'y', '').length, 2, "test 4");
+assert.sameValue(AsyncGeneratorFunction('x, y', '').length, 2, "test 5");
+
+
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-name.js b/test/built-ins/AsyncGeneratorFunction/instance-name.js
new file mode 100644
index 000000000..62e47d643
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-asyncgeneratorfunction
+description: Assignment of function `name` attribute
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ RuntimeSemantics: CreateDynamicFunction(constructor, newTarget, kind, args)
+ ...
+ 29. Perform SetFunctionName(F, "anonymous").
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var instance = AsyncGeneratorFunction()
+
+verifyProperty(instance, "name", {
+ value: "anonymous",
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-prototype.js b/test/built-ins/AsyncGeneratorFunction/instance-prototype.js
new file mode 100644
index 000000000..57c2efd26
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-prototype.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: Definition of instance `prototype` property
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ Runtime Semantics: CreateDynamicFunction
+ ...
+ 37. Else if kind is "async generator", then
+ a. Let prototype be ObjectCreate(%AsyncGeneratorPrototype%).
+ b. Perform DefinePropertyOrThrow(F, "prototype",
+ PropertyDescriptor{[[Value]]: prototype, [[Writable]]: true,
+ [[Enumerable]]: false, [[Configurable]]: false}).
+ ...
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var instance = AsyncGeneratorFunction();
+
+assert.sameValue(typeof instance.prototype, 'object');
+assert.sameValue(
+ Object.getPrototypeOf(instance.prototype),
+ Object.getPrototypeOf(instance).prototype
+);
+
+verifyProperty(instance, "prototype", {
+ enumerable: false,
+ writable: true,
+ configurable: false,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/instance-yield-expr-in-param.js b/test/built-ins/AsyncGeneratorFunction/instance-yield-expr-in-param.js
new file mode 100644
index 000000000..5bddd0a89
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/instance-yield-expr-in-param.js
@@ -0,0 +1,42 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: Definition of instance `length` property
+info: |
+ AsyncGeneratorFunction ( p1, p2, … , pn, body )
+ ...
+ 3. Return CreateDynamicFunction(C, NewTarget, "async generator", args).
+
+ Runtime Semantics: CreateDynamicFunction
+ ...
+ 28. If kind is "generator" or "async generator", then
+ a. If parameters Contains YieldExpression is true, throw a SyntaxError
+ exception.
+features: [async-iteration]
+flags: [async]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+// YieldExpression is permitted in function body.
+AsyncGeneratorFunction('x = yield');
+
+assert.throws(SyntaxError, function() {
+ AsyncGeneratorFunction('x = yield', '');
+}, 'YieldExpression not permitted generally');
+
+var withinAsyncGenerator = async function*() {
+ AsyncGeneratorFunction('x = yield', '');
+};
+
+withinAsyncGenerator().next().then(
+ function () {
+ throw new Test262Error("YieldExpression not permitted when calling context is a async generator");
+ },
+ function (e) {
+ if (!(e instanceof SyntaxError)) {
+ throw new Test262Error("Expected SyntaxError but got " + e);
+ }
+ }
+).then($DONE, $DONE);
diff --git a/test/built-ins/AsyncGeneratorFunction/invoked-as-constructor-no-arguments.js b/test/built-ins/AsyncGeneratorFunction/invoked-as-constructor-no-arguments.js
new file mode 100644
index 000000000..6400a8e53
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/invoked-as-constructor-no-arguments.js
@@ -0,0 +1,20 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: >
+ When invoked via the constructor invocation pattern without arguments, the
+ GeneratorFunction intrinsic returns a valid async generator with an empty body.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var g = new AsyncGeneratorFunction();
+var iter = g();
+
+iter.next().then(function(result) {
+ assert.sameValue(result.value, undefined, 'Result `value`');
+ assert.sameValue(result.done, true, 'Result `done` flag');
+}).then($DONE, $DONE)
+
diff --git a/test/built-ins/AsyncGeneratorFunction/invoked-as-function-multiple-arguments.js b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-multiple-arguments.js
new file mode 100644
index 000000000..7e7ee7a91
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-multiple-arguments.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: >
+ When invoked via the function invocation pattern with multiple arguments,
+ the AsyncGeneratorFunction intrinsic creates a valid generator whose body is the
+ last argument evaluated as source code and whose formal parameters are
+ defined by the preceeding arguments.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var g = AsyncGeneratorFunction('x', 'y', 'yield x + y;');
+var iter = g(2, 3);
+
+iter.next().then(function(result) {
+ assert.sameValue(result.value, 5, '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, 'Final result `value`');
+ assert.sameValue(result.done, true, 'Final result `done` flag');
+}).then($DONE, $DONE)
diff --git a/test/built-ins/AsyncGeneratorFunction/invoked-as-function-no-arguments.js b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-no-arguments.js
new file mode 100644
index 000000000..e3b7c24f1
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-no-arguments.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: >
+ When invoked via the function invocation pattern without arguments, the
+ AsyncGeneratorFunction intrinsic returns a valid generator with an empty body.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var g = AsyncGeneratorFunction();
+var iter = g();
+
+iter.next().then(function(result) {
+ assert.sameValue(result.value, undefined, 'Result `value`');
+ assert.sameValue(result.done, true, 'Result `done` flag');
+}).then($DONE, $DONE)
diff --git a/test/built-ins/AsyncGeneratorFunction/invoked-as-function-single-argument.js b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-single-argument.js
new file mode 100644
index 000000000..d7329136f
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/invoked-as-function-single-argument.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction
+description: >
+ When invoked via the function invocation pattern with a single argument,
+ the AsyncGeneratorFunction intrinsic creates a valid async generator whose body is the
+ first argument evaluated as source code.
+features: [async-iteration]
+flags: [async]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+var g = AsyncGeneratorFunction('yield 1;');
+var iter = g();
+var result;
+
+
+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, 'Final result `value`');
+ assert.sameValue(result.done, true, 'Final result `done` flag');
+}).then($DONE, $DONE)
diff --git a/test/built-ins/AsyncGeneratorFunction/length.js b/test/built-ins/AsyncGeneratorFunction/length.js
new file mode 100644
index 000000000..5b7fbf590
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/length.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction-length
+description: >
+ This is a data property with a value of 1. This property has the attributes
+ { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+verifyProperty(AsyncGeneratorFunction, "length", {
+ value: 1,
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/name.js b/test/built-ins/AsyncGeneratorFunction/name.js
new file mode 100644
index 000000000..17132afc5
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/name.js
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-asyncgeneratorfunction
+description: Function "name" property
+info: |
+ The value of the name property of the AsyncGeneratorFunction
+ is "AsyncGeneratorFunction".
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value is a
+ String.
+
+ Unless otherwise specified, the name property of a built-in Function object,
+ if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]:
+ false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+verifyProperty(AsyncGeneratorFunction, "name", {
+ value: "AsyncGeneratorFunction",
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js b/test/built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js
new file mode 100644
index 000000000..78b38767a
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/prototype/Symbol.toStringTag.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-asyncgeneratorfunction-prototype-tostringtag
+description: >
+ `Symbol.toStringTag` property descriptor
+info: |
+ The initial value of the @@toStringTag property is the String
+ value "AsyncGeneratorFunction".
+
+ This property has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [async-iteration, Symbol.toStringTag]
+---*/
+
+var AsyncGeneratorFunctionPrototype = Object.getPrototypeOf(async function*() {});
+
+verifyProperty(AsyncGeneratorFunctionPrototype, Symbol.toStringTag, {
+ value: 'AsyncGeneratorFunction',
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/prototype/constructor.js b/test/built-ins/AsyncGeneratorFunction/prototype/constructor.js
new file mode 100644
index 000000000..c36680252
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/prototype/constructor.js
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction-prototype-constructor
+description: >
+ `constructor` property of the AsyncGeneratorFunction.prototype object
+info: |
+ The initial value of AsyncGeneratorFunction.prototype.constructor is the intrinsic
+ object %AsyncGeneratorFunction%.
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]:
+ false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+assert.sameValue(AsyncGeneratorFunction.prototype.constructor, AsyncGeneratorFunction);
+
+verifyProperty(AsyncGeneratorFunction.prototype, "constructor", {
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/prototype/extensibility.js b/test/built-ins/AsyncGeneratorFunction/prototype/extensibility.js
new file mode 100644
index 000000000..b4360e4f1
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/prototype/extensibility.js
@@ -0,0 +1,14 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-properties-of-asyncgenerator-prototype
+description: Object extensibility
+info: |
+ The initial value of the [[Extensible]] internal slot of the
+ AsyncGeneratorFunction prototype object is true.
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+assert(Object.isExtensible(AsyncGeneratorFunction.prototype));
diff --git a/test/built-ins/AsyncGeneratorFunction/prototype/prop-desc.js b/test/built-ins/AsyncGeneratorFunction/prototype/prop-desc.js
new file mode 100644
index 000000000..a1b49c240
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/prototype/prop-desc.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: AsyncGeneratorFunction.prototype property descriptor
+esid: sec-asyncgeneratorfunction-prototype
+info: |
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]:
+ false, [[Configurable]]: false }.
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunction = Object.getPrototypeOf(async function* () {}).constructor;
+
+verifyProperty(AsyncGeneratorFunction, "prototype", {
+ enumerable: false,
+ writable: false,
+ configurable: false,
+});
diff --git a/test/built-ins/AsyncGeneratorFunction/prototype/prototype.js b/test/built-ins/AsyncGeneratorFunction/prototype/prototype.js
new file mode 100644
index 000000000..66c5cd170
--- /dev/null
+++ b/test/built-ins/AsyncGeneratorFunction/prototype/prototype.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-asyncgeneratorfunction-prototype-prototype
+description: >
+ The value of AsyncGeneratorFunction.prototype.prototype is the
+ %AsyncGeneratorPrototype% intrinsic object.
+
+ This property has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [async-iteration]
+---*/
+
+var AsyncGeneratorFunctionPrototype = Object.getPrototypeOf(async function*() {});
+
+assert.sameValue(
+ AsyncGeneratorFunctionPrototype.prototype,
+ Object.getPrototypeOf(async function*() {}.prototype)
+);
+
+verifyProperty(AsyncGeneratorFunctionPrototype, "prototype", {
+ enumerable: false,
+ writable: false,
+ configurable: true,
+});