kripken/emscripten — Issue #241: TypeError: Cannot read property 'isString' of undefined
Author: paleozogt
Created: 2012-02-09 22:07:40+00:00
State: open

When linking an emscripten "executable" .js file, I get the error below. I can't provide you with the code, unfortunately. :( Is there a way to backtrack this error to the C++ code that is causing it?

```
Warning: Applying some potentially unsafe optimizations! (Use -O2 if this fails.)
emcc: warning: using libcxx turns on CORRECT_* options

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot read property 'isString' of undefined
at Object.processItem (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at Object.process (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at Object.solve (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at JSify (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at finalCombiner (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at JSify (eval at globalEval (/Users/asimmons/Development/emscripten/src/compiler.js:79:8))
at Object. (/Users/asimmons/Development/emscripten/src/compiler.js:190:1)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
Traceback (most recent call last):
File "/Users/asimmons/Development/emscripten/emcc", line 637, in
flush_js_optimizer_queue()
File "/Users/asimmons/Development/emscripten/emcc", line 618, in flush_js_optimizer_queue
final = shared.Building.js_optimizer(final, js_optimizer_queue)
File "/Users/asimmons/Development/emscripten/tools/shared.py", line 695, in js_optimizer
assert len(output) > 0 and not output.startswith('Assertion failed'), 'Error in js optimizer: ' + err + '\n\n' + output
AssertionError: Error in js optimizer:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot use 'in' operator to search for 'globalEval' in null
at String.IN (native)
at isGenerated (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:123:19)
at /Users/asimmons/Development/emscripten/tools/js-optimizer.js:200:31
at traverse (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:170:18)
at traverseChildren (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:144:23)
at traverse (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:176:9)
at traverseChildren (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:144:23)
at traverse (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:176:9)
at traverseGeneratedFunctions (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:199:3)
at Object.hoistMultiples (/Users/asimmons/Development/emscripten/tools/js-optimizer.js:896:3)
```