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
For background, see PR #9 adding failing unit tests for generators. Both compilation and serialization don't seem to work; target is set to ES5 but ES6 and ES3 were also attempted.
This is a very strange bug, as Typescript already polyfills generator support to ES5 in a very similar way that it does async/await support.
I am attaching the failing unit test results from the CLI.
31 passing (11s)
3 failing
1) Serialization
generator.ts:simpleGenerator:
TypeError: Cannot read property 'label' of undefined
at C:\Users\-\Desktop\Code\ts-serialize-closures\ts-closure-transform\test\serialization\generator.js:34:26
at step (test\serialization\generator.js:23:23)
at Object.next (test\serialization\generator.js:4:53)
at Context.simpleGenerator (test\serialization\generator.js:47:26)
at processImmediate (internal/timers.js:439:21)
2) Serialization
generator.ts:roundtripGenerator:
ReferenceError: __generator is not defined
at myGenerator (eval at _l (C:\Users\-\Desktop\Code\ts-serialize-closures\serialize-closures\src\serializedGraph.js:395:20), <anonymous>:2:5)
at myGenerator (C:\Users\-\Desktop\Code\ts-serialize-closures\serialize-closures\src\serializedGraph.js:328:39)
at Context.roundtripGenerator (test\serialization\generator.js:51:34)
at processImmediate (internal/timers.js:439:21)
3) Serialization
generator.ts:roundtripGeneratorInProgress:
TypeError: Cannot read property 'label' of undefined
at C:\Users\-\Desktop\Code\ts-serialize-closures\ts-closure-transform\test\serialization\generator.js:34:26
at step (test\serialization\generator.js:23:23)
at Object.next (test\serialization\generator.js:4:53)
at Context.roundtripGeneratorInProgress (test\serialization\generator.js:56:16)
at processImmediate (internal/timers.js:439:21)
The text was updated successfully, but these errors were encountered:
It seems we inject invalid code in the switch statement switch (_a.value.label) should be switch (_a.label). I don't have time to look further into this at the moment, but I did add some comments in your PR.
0415304 fixes the invalid .value property injection. It's an interesting bug that I might report upstream (tsc). This fix allows the first unit test to succeed.
For background, see PR #9 adding failing unit tests for generators. Both compilation and serialization don't seem to work; target is set to ES5 but ES6 and ES3 were also attempted.
This is a very strange bug, as Typescript already polyfills generator support to ES5 in a very similar way that it does async/await support.
I am attaching the failing unit test results from the CLI.
The text was updated successfully, but these errors were encountered: