-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.4.5
Search Terms:
tsc crash for .js where curly bracket object assignment is used in conjunction with OR assignment
Code
tsconfig:
..."allowJs" : true...
simple-js-file.js:
var NameSpace = NameSpace || { Shared: {} }; //DOES NOT WORK
Equivalent works:
var NameSpace = NameSpace || {};
NameSpace.Shared = {}; // WORKS
Expected behavior:
Typescript to compile the .js file to the out folder (Like the second example)
Actual behavior:
tsc : C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:72970
At line:1 char:1
+ tsc
+ ~~~
+ CategoryInfo : NotSpecified: (C:\Users\TJevon...ib\tsc.js:72970:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
throw e;
^
RangeError: Maximum call stack size exceeded
at checkPropertyAccessExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:41094:47)
at checkExpressionWorker (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:44380:28)
at checkExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:44317:38)
at checkTruthinessExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:46358:24)
at checkBinaryLikeExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:43762:28)
at checkBinaryExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:43753:20)
at checkExpressionWorker (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:44420:28)
at checkExpression (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:44317:38)
at checkExpressionCached (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:44106:38)
at getInitializerTypeFromAssignmentDeclaration (C:\Users\TJevon\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:29597:97)
Playground Link:
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue