@@ -1478,12 +1478,21 @@ function crash(stage, e) {
1478
1478
EOL ,
1479
1479
BAR , "Whoops, the AssemblyScript compiler has crashed during " , stage , " :-(" , EOL ,
1480
1480
BAR , EOL ,
1481
- BAR , "Here is a stack trace that may or may not be useful:" , EOL ,
1482
- BAR , EOL ,
1483
- e . stack . replace ( / ^ / mg, BAR ) , EOL ,
1484
- BAR , EOL ,
1485
- BAR , "If it refers to the dist files, try to 'npm install source-map-support' and" , EOL ,
1486
- BAR , "run again, which should then show the actual code location in the sources." , EOL ,
1481
+ ( typeof e . stack === "string"
1482
+ ? [
1483
+ BAR , "Here is the stack trace hinting at the problem, perhaps it's useful?" , EOL ,
1484
+ BAR , EOL ,
1485
+ e . stack . replace ( / ^ / mg, BAR ) , EOL ,
1486
+ BAR , EOL ,
1487
+ BAR , "If it refers to the dist files, try to 'npm install source-map-support' and" , EOL ,
1488
+ BAR , "run again, which should then show the actual code location in the sources." , EOL ,
1489
+ ]
1490
+ : [
1491
+ BAR , "There is no stack trace. Perhaps a Binaryen exception above / in console?" , EOL ,
1492
+ BAR , EOL ,
1493
+ BAR , "> " + e . stack , EOL
1494
+ ]
1495
+ ) . join ( "" ) ,
1487
1496
BAR , EOL ,
1488
1497
BAR , "If you see where the error is, feel free to send us a pull request. If not," , EOL ,
1489
1498
BAR , "please let us know: https://github.com/AssemblyScript/assemblyscript/issues" , EOL ,
0 commit comments