Skip to content

Conversation

@benjamingr
Copy link

No description provided.

type: SyntaxError
---*/

(async function* (await) {}); No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe these two early errors tests are already present in the PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger, removed.

---*/

(async function*() {})().next.call((function*() {})()).then(assert.throw.bind(assert), function(err) {
ass9ert(err instanceof TypeError);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: typo.

I would also declare the functions as variables here and put logic on more lines

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good

esid: pending
description: >
next() rejects with a TypeError when receiver is not an AsyncGenerator instance:
phase: early
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phase and type frontmatter bits should be removed, since this is not really a negative test

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger

type: TypeError
---*/

(async function*() {})().next.call((function*() {})()).then(assert.throw.bind(assert), function(err) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably a better way to assert that the resolve handler is never called. Maybe just throw a Teat262Assertion in the handler indicating that it shouldn't be called, it's easier to understand

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find Test262Assertion (or Teat262Assertion) in the source. I'll throw an Error - let me know if that's fine.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile Swype makes code review hard. It's Test262Error

/*---
esid: early
description: >
`Symbol.iterator` property descriptor
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsyncIterator


var OSymbol = $.createRealm().global.Symbol;

assert.sameValue(Symbol.asyncIterator, Symbol.asyncIterator);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion looks wrong, missing the other realm symbol

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, fixed.

features: [Symbol.asyncIterator]
---*/

var OSymbol = $.createRealm().global.Symbol;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OSymbol could probably be more descriptive of what it is

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied it from the regular async function tests, what would be a good name?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably call it otherRealmSymbol, but it's just personal preference

@benjamingr
Copy link
Author

benjamingr commented Jan 13, 2017 via email

Benjamin Gruenbaum added 2 commits January 13, 2017 17:45
symbol tests

more symbol tests

feedback by caitp

simplify

symbol test fix

built in tests initial work

ORealm -> otherRealmSymbol

Error->Test262Error

figure out what these tests mean

subclass tests

6.3.2.1
@benjamingr benjamingr force-pushed the AsyncGeneratorExpressions branch from c149e24 to 93e6855 Compare January 13, 2017 15:46
sasha and others added 10 commits January 13, 2017 17:47
# The first commit's message is:

initial work

fix test to reject instead of throw

symbol tests

more symbol tests

feedback by caitp

simplify

symbol test fix

built in tests initial work

ORealm -> otherRealmSymbol

Error->Test262Error

figure out what these tests mean

 AsyncGeneratorMethod throw a SyntaxError if UniqueFormalParameters contains AwaitExpression
 AsyncGeneratorMethod throw a SyntaxError if UniqueFormalParameters contains YieldExpression.
 AsyncGeneratorMethod throw a SyntaxError if HasDirectSuper of AsyncGeneratorMethod is true.

async generators test

fix test to reject instead of throw

symbol tests

more symbol tests

feedback by caitp

simplify

symbol test fix

built in tests initial work

ORealm -> otherRealmSymbol

Error->Test262Error

figure out what these tests mean

subclass tests

6.3.2.1

# This is the commit message caitp#2:

test name

# This is the commit message tc39#3:

port thefourtheyes tests

# This is the commit message tc39#4:

fixed async/yield test naming (added expression), also added two tests for yield/await named params

# This is the commit message tc39#5:

oops, untracked accesors

# This is the commit message tc39#6:

renamed tests to conform with other early tests

# This is the commit message tc39#7:

removed unnecessary copyright

# This is the commit message tc39#8:

added wrongly created file

# This is the commit message tc39#9:

Update AsyncGenerator-is-extensible.js
@benjamingr benjamingr force-pushed the AsyncGeneratorExpressions branch from fced437 to 17c6ab2 Compare January 13, 2017 17:47
@benjamingr
Copy link
Author

OK, we're done for the day, please take a look and let me know.

@benjamingr
Copy link
Author

@caitp I'm done for the day - please take a look, I'll fix any issues you run into.

Copy link
Owner

@caitp caitp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the one thing is, I think it's better if the tests by each author are grouped into their own commits, and possibly their own pull requests on the test262 repository, to make CLA verification easier, and so that the author of specific tests is attributed as the author of the commit when merged.

I think I'd prefer to review this stuff on the upstream repository. But here's a few minor comments

author: Benjamin Gruenbaum <benjamingr@gmail.com>
esid: pending
description: >
%AsyncGeneratorProrotype% creates functions with or without new and handles arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly about arguments parsing in CreateDynamicFunction

description: >
%AsyncGeneratorFunction% is a subclass of Function
(The AsyncGeneratorFunction constructor is a standard built-in
function object that inherits from the Function constructor. )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parenthesized bit might not add much, dunno

---*/

async function* foo() { };
assert("next" in Object.getPrototypeOf(foo()));
Copy link
Owner

@caitp caitp Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do hasOwnProperty instead here and similar places, rather than "in" --- or even just getOwnProperty and check the property descriptor too

/*---
author: Sakthipriyan Vairamani (thefourtheye) <thechargingvolcano@gmail.com>
description: Check if %AsyncGeneratorFunction% function's `prototype`
object's `constructor` property is %AsyncGeneratorFunction%
Copy link
Owner

@caitp caitp Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove "Check if"

`.constructor` property.
---*/

const AsyncGeneratorFunction = async function* () {}.constructor;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many test262 tests avoid using lexical variables unless specifically testing things related to lexical variables

@@ -0,0 +1,17 @@
// Copyright (C) 2015-2017 the V8 project authors. All rights reserved.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably rename this file to just "asyncIterator.js" unless this matches the conventions of the other well known symbol tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the conventions of the async function tests. I don't feel strongly about the name though.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough

@caitp caitp force-pushed the AsyncGeneratorExpressions branch from c43a36a to 995b9af Compare January 19, 2017 19:27
---*/


assert.sameValue(Symbol.asyncIterator.name, '[Symbol.asyncIterator]');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"[Symbol.asyncIterator]" is not a name of the symbol, but the method of %AsyncIteratorPrototype%
https://tc39.github.io/proposal-async-iteration/#sec-asynciteratorprototype-asynciterator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants