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
// A self-contained demonstration of the problem follows...consttest=Symbol('name');classFoo{constructor(){console.log('Foo constructor');}}Foo[test]='testing a symbol';classBarextendsFoo{constructor(){super();console.log('Bar constructor');}}letb=newBar();console.log(Bar[test]);
Expected behaviour:
Should output
Foo constructor
Bar constructor
testing a symbol
Actual behaviour:
Actual output is
Foo constructor
Bar constructor
undefined
This is because the __extends helper uses hasOwnProperty to check for properties to be copied over. Symbols are not properties, so they are never copied.
This works correctly with native ES6 classes, and with Babel's _inherits helper (using Object.setPrototypeOf rather than copying properties manually).
The text was updated successfully, but these errors were encountered:
TypeScript Version:
1.8.7
Code
Expected behaviour:
Should output
Actual behaviour:
Actual output is
This is because the __extends helper uses
hasOwnProperty
to check for properties to be copied over. Symbols are not properties, so they are never copied.This works correctly with native ES6 classes, and with Babel's _inherits helper (using Object.setPrototypeOf rather than copying properties manually).
The text was updated successfully, but these errors were encountered: