Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

test AsyncGeneratorFunction's basic properties #71

Closed
wants to merge 1 commit into from

Conversation

thefourtheye
Copy link

Included basic tests for properties of AsyncGeneratorFunction to begin with.

cc @benjamingr

@benjamingr
Copy link

Great start, I'll work on it this Friday!

@caitp
Copy link

caitp commented Jan 11, 2017

Based on @bterlson's earlier work on tests for async functions, I think built-ins/AsyncGeneratorFunction/ is a good place to put tests on properties of AsyncGeneratorFunction instances.

How about something like this?

// https://tc39.github.io/proposal-async-iteration/#sec-asyncgenerator-definitions-instantiatefunctionobject
async function* fn() { };
var AsyncGeneratorFunction = fn.constructor;
assert.sameValue(Object.getPrototypeOf(fn.prototype), AsyncGeneratorFunction.prototype.prototype,
	         "fn.prototype should have a [[Prototype]] of %AsyncGeneratorPrototype%");
verifyWritable(fn, "prototype");
verifyNotEnumerable(fn, "prototype");
verifyNotConfigurable(fn, "prototype");

Brian's work has some other good examples of useful tests, like verifying the behaviour of CreateDynamicFunction + async generators

@benjamingr
Copy link

Going to copy this to the new PR.

@benjamingr
Copy link

Copied what I could and rewrote the rest in the new format.

@domenic domenic closed this Dec 4, 2017
@thefourtheye thefourtheye deleted the basic-tests branch February 5, 2018 06:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants