Closed yoosiba closed 6 years ago
String based enums have no runtime manifestation of the type which leads to runtime exceptions
// module Defs export public enum X{ X1 : "x one" } @StringBased export public enum Y{ Y1 : "y one" } //caller module import {X} from "Defs"; import {Y} from "Defs"; console.log(X) // { [Function: X] X1: X { name: 'X1', value: 'x one' } } console.log(Y) // undefined console.log(N4Type.of(X).fqn); // Defs.X console.log(N4Type.of(Y).fqn); // runtime error
runtime output
{ [Function: X] X1: X { name: 'X1', value: 'x one' } } undefined Defs.X (SystemJS) Cannot read property 'fqn' of undefined TypeError: Cannot read property 'fqn' of undefined at execute (/Users/me/work/workspace/MyProj/src-gen/es/MyProj/Caller.js:18:29) Error loading MyProj/Caller
String based enums have no runtime manifestation of the type which leads to runtime exceptions
runtime output