diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-16 21:07:19 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-16 21:07:19 -0700 |
commit | 4197860af16ed859e6a7d63045f4d4bf5305bcdb (patch) | |
tree | 6ec260f1b4ca4b355a87057e6cbd42b12bab7458 | |
parent | 3baf8e7f6927ba173e8c797f20ddef98179f898e (diff) |
error on undefined symbols in asm.js mode, since it breaks validation and must be corrected
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rwxr-xr-x | tests/runner.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 4263618a..38029377 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -513,7 +513,9 @@ function JSify(data, functionsOnly, givenFunctions) { item.JS = addFromLibrary(shortident); } else if (!LibraryManager.library.hasOwnProperty(shortident + '__inline')) { item.JS = 'var ' + item.ident + '; // stub for ' + item.ident; - if (WARN_ON_UNDEFINED_SYMBOLS || ASM_JS) { // always warn on undefs in asm, since it breaks validation + if (ASM_JS) { + throw 'Unresolved symbol: ' + item.ident + ', this must be corrected for asm.js validation to succeed'; + } else if (WARN_ON_UNDEFINED_SYMBOLS) { warn('Unresolved symbol: ' + item.ident); } } diff --git a/tests/runner.py b/tests/runner.py index f2a0bd4e..9ca444fb 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -9329,7 +9329,7 @@ f.close() filename = self.in_dir('src.cpp') open(filename, 'w').write(src) out, err = Popen([PYTHON, EMCC, filename, '-s', 'ASM_JS=1', '-O2'], stderr=PIPE).communicate() - assert 'Warning: Unresolved symbol' in err, 'always warn on undefs in asm, since it breaks validation' + assert 'Unresolved symbol' in err, 'always warn on undefs in asm, since it breaks validation: ' + err def test_redundant_link(self): lib = "int mult() { return 1; }" |