Open
Description
Basically what it says on the tin. This also affects #247, when it is merged. This is a very niche thing, but it would be cool to handle. The issue is that it is quite difficult to handle, as it can happen anywhere.
Presumably fixing this would involve adding extends Object
to every class declaration. However, I'm unsure if there are some built-in classes that could be extended this way, i.e. if Hackmud freezes all classes, so that needs some investigation. Because in that case, we can't do the super.valueOf()
trick, if the class doesn't have some superclass.
Repro script
class Foo {
a() {
this.b = 1
}
}
Foo.prototype.getB = function() {
return this.b
}
const bar = {
a() {
this.b = 1
}
}
bar.getB = function() {
return this.b
}
Metadata
Metadata
Assignees
Labels
No labels