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
Expected behavior:
The order of class declarations in TypeScript should not be important. As evidence, the above code passes compilation and thus should not cause runtime error
.
Actual behavior:
Runtime error is thrown Uncaught TypeError: Cannot read property 'prototype' of undefined on line 4.
The reason is that in the call to __extends(SubClass, _super) on line 7 the _super variable is undefined, but the __extends function checks for strict null (b === null on line 4) and thus fails on undefined.
The text was updated successfully, but these errors were encountered:
The order of class declarations in TypeScript should not be important. As evidence, the above code passes compilation and thus should not cause runtime error
is against ES semantics. The runtime behavior is correct. What's missing is the compile-time error.
TypeScript Version:
1.8.10
Code
generated code:
Expected behavior:
The order of class declarations in TypeScript should not be important. As evidence, the above code passes compilation and thus should not cause runtime error
.
Actual behavior:
Runtime error is thrown
Uncaught TypeError: Cannot read property 'prototype' of undefined
on line 4.The reason is that in the call to
__extends(SubClass, _super)
on line 7 the _super variable is undefined, but the __extends function checks for strict null (b === null
on line 4) and thus fails on undefined.The text was updated successfully, but these errors were encountered: