Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Invoke superclass constructor even if its .prototype is null #755

Merged
merged 1 commit into from
Dec 20, 2016

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Dec 19, 2016

Fixes #699: currently the below new does not invoke A; with this change it does.

function A() { this.x = 1; }
A.prototype = null;

new class extends A {}

As mentioned there, this is a normative change, but it causes the spec to match current behavior on (at least) Chrome and Firefox and so probably isn't breaking.

At the moment it does nothing to resolve the scoping issue mentioned here.

@bakkot
Copy link
Contributor Author

bakkot commented Dec 19, 2016

test262 collateral here, since this is a normative change.

@bterlson
Copy link
Member

This seems fine to me (and the semantics I intended when implementing a35f0f3). I'll think about some way to avoid the "scoping" issue. Thanks for the test262 collateral!

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.

Classes extending a function with .prototype=null
2 participants