You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently support extends null using #3516 and #3524, but I was wondering if we might also want to error on incorrectly using 'extends null'
classCextendsnull{x: number;}varc: C;c.toString()
From the Mozilla docs "Extending from null works like with a normal class, except that the prototype object does not inherit from Object.prototype."
I may be missing something in the above example (apologies if so), but it looks like we might want to warn on the use of toString since, assuming I'm reading it correctly, this method does not exist on an instance of C.
The text was updated successfully, but these errors were encountered:
sophiajt
changed the title
'extends null' doesn't seem to error on using methods from Object.prototype
'extends null' doesn't error on using methods from Object.prototype
Aug 25, 2015
This is by design so far. We assume that Object is the super type of everything. if we want this to work, we need to change this assumption. the complexity of the change does not map to the value added to the user by enabling this feature.
mhegazy
added
By Design
Deprecated - use "Working as Intended" or "Design Limitation" instead
Won't Fix
The severity and priority of this issue do not warrant the time or complexity needed to fix it
Bug
A bug in TypeScript
and removed
By Design
Deprecated - use "Working as Intended" or "Design Limitation" instead
labels
Aug 26, 2015
We currently support extends null using #3516 and #3524, but I was wondering if we might also want to error on incorrectly using 'extends null'
From the Mozilla docs "Extending from null works like with a normal class, except that the prototype object does not inherit from Object.prototype."
I may be missing something in the above example (apologies if so), but it looks like we might want to warn on the use of toString since, assuming I'm reading it correctly, this method does not exist on an instance of C.
The text was updated successfully, but these errors were encountered: