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
Actual behavior:
The .js file is not emitted due to a compiler exception. Message and stack trace:
TypeError: Cannot read property 'transformFlags' of null
at aggregateTransformFlagsForNode (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:54626:18)
at Object.aggregateTransformFlags (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:54611:9)
at visitNode (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:53754:12)
at Object.visitEachChild (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:54053:108)
at visitVariableDeclaration (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:61625:30)
at Object.flatMap (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:2047:25)
at visitVariableDeclarationList (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:61510:39)
at visitJavaScript (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:60282:28)
at visitor (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:60243:24)
at visitNode (d:\solutions\transformer-issue-compiler\node_modules\typescript\lib\typescript.js:53755:23)
Even if I remove the ts.createToken(ts.SyntaxKind.ConstKeyword) token, this exception is still thrown.
Also, the console.log statement prints the following (the var keyword is left there):
80% sure the problem is that you're passing null instead of undefined for some of those parameters. The TS API basically never uses null and will behave badly if given it because it's only ever checking for === undefined
Replacing the null in createVariableDeclaration with undefined made the exception go away (wasn't needed on createMethod), however it still prints const var.
TypeScript Version: 2.8.0-dev.20180307
Search Terms: createVariableStatement const
Code (compiler)
Code (test program, ../transformer-issue-src/src/A.ts)
Expected behavior:
The .js file should be emitted.
The
console.log
statement should print the following:Actual behavior:
The .js file is not emitted due to a compiler exception. Message and stack trace:
Even if I remove the
ts.createToken(ts.SyntaxKind.ConstKeyword)
token, this exception is still thrown.Also, the
console.log
statement prints the following (the var keyword is left there):The text was updated successfully, but these errors were encountered: