Skip to content

Change tests for extends null and Intl legacy constructor semantics#855

Merged
leobalter merged 7 commits intotc39:masterfrom
anba:fix-async-sab-class-tests
Mar 1, 2017
Merged

Change tests for extends null and Intl legacy constructor semantics#855
leobalter merged 7 commits intotc39:masterfrom
anba:fix-async-sab-class-tests

Conversation

@anba
Copy link
Contributor

@anba anba commented Feb 10, 2017

The main changes are for tc39/ecma262#781 and tc39/ecma402#84, plus some other small bug fixes.

tc39/ecma402#84 also needs new tests, but I'd like to fix the failing tests first.

Copy link
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

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

All of these changes look great. Thanks for your attention to detail in updating the tests for extending null, as well as fixing that SAB test bug (I ran into this when trying to do apply the latest test262 tests but didn't follow up nicely as you did).

I'm working on tests for the constructor path (I guess for complete tests we'll have to figure out what the [[Description]] should be), by the way.

/*---
es5id: 12.1.1_1
description: Tests that the this-value is ignored in DateTimeFormat.
description: Tests that the this-value is ignored in DateTimeFormat, if the this-value isn't a DateTimeFormat instance.
Copy link
Member

Choose a reason for hiding this comment

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

Optional nit: this could be word-wrapped.

@anba anba force-pushed the fix-async-sab-class-tests branch from 1b6b382 to 878d382 Compare February 22, 2017 17:12
@anba
Copy link
Contributor Author

anba commented Feb 22, 2017

Rebased and merged the fixup commit. Also added a new commit to fix typos in the new built-ins/TypedArray/prototype/copyWithin tests.

@leobalter leobalter self-assigned this Mar 1, 2017
assert(calledExecutor);
assert.sameValue(executorArguments.length, 2);
assert.sameValue(typeof executorArguments[0], "function");
assert.sameValue(typeof executorArguments[1], "function");
Copy link
Member

Choose a reason for hiding this comment

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

so much better testing this way!

var f = new Foo();

assert.sameValue(f, obj);
assert.sameValue(Object.getPrototypeOf(f), Object.prototype);
Copy link
Member

Choose a reason for hiding this comment

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

this second assertion became unnecessary, but it does not hurt keeping it.

constructor() {
reachable += 1;
super();
super(unreachable += 1);
Copy link
Member

Choose a reason for hiding this comment

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

nice!

class Foo extends null {
constructor() {}
constructor() {
}
Copy link
Member

Choose a reason for hiding this comment

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

in a follow up PR, we could verify this is called. the reachable += 1 approach would be good enough

assert.sameValue(instance, thisVal);
assert.throws(ReferenceError, function() {
new C();
});
Copy link
Member

Choose a reason for hiding this comment

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

again a suggestion for a follow up PR: this is not what we are really asserting in this test, so a try catch block would avoid ambiguity.

// Use an arrow function to access the `this` binding of the class constructor.
assert.throws(ReferenceError, () => {
this;
});
Copy link
Member

Choose a reason for hiding this comment

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

This is great!

@leobalter
Copy link
Member

Everything is looking great here, I found a few things that could be changed/improved but it's not necessary to block this PR.

@leobalter leobalter merged commit 4546006 into tc39:master Mar 1, 2017
@anba anba deleted the fix-async-sab-class-tests branch June 25, 2020 09:06
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.

3 participants