-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Revert to *.prototype.is* = true #21293
Conversation
I think I might've confused you and this whole situation. Could someone else please provide some clarity for the related issues. never mind my guess thenmy guess is that: class foo {
bar = 1
} is equivalent to: class foo {}
foo.prototype.bar =1 |
No. It's not equivalent. |
I'm at a loss on this one. The following works fine in the browser and if I'd understood that earlier I wouldn't have worried about changing as much around as I did with my movements towards classes. We could have gone slower. I apologize @mrdoob. class foo {
constructor(param) {
this.thing = param
}
}
foo.prototype.value = 1
Object.assign(foo.prototype, {a:'...'})
class bar extends foo { }
Object.assign(bar.prototype, {a:"... ..."})
const y = new foo("aaa")
console.log(y.value);
console.log(y.a);
console.log(y.thing);
const x = new bar("dsa")
console.log(x.value);
console.log(x.a);
console.log(x.thing); logs:
|
@linbingquan Actually, I think that'd be great. Please, go ahead and clean that up 🙏 |
Related issue: #21284 #21285