diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 20:13:25 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-20 20:13:25 -0700 |
commit | c5c45bafedd945ac7c6be9632e5ea4aa583a1915 (patch) | |
tree | 8c7d0211df42728336a44525c979c46d52063129 /src | |
parent | aee53a0899d31926113d23536d1277c5d96e8fd0 (diff) |
abort compilation if there are unresolved in asm.js, after showing them all
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rw-r--r-- | src/utility.js | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index c720e566..b966b5c8 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -515,7 +515,7 @@ function JSify(data, functionsOnly, givenFunctions) { if (!(item.ident in DEAD_FUNCTIONS) && !UNRESOLVED_AS_DEAD) { item.JS = 'var ' + item.ident + '; // stub for ' + item.ident; if (ASM_JS) { - throw 'Unresolved symbol: ' + item.ident + ', this must be corrected for asm.js validation to succeed. Consider adding it to DEAD_FUNCTIONS.'; + error('Unresolved symbol: ' + item.ident + ', this must be corrected for asm.js validation to succeed. Consider adding it to DEAD_FUNCTIONS.'); } else if (WARN_ON_UNDEFINED_SYMBOLS) { warn('Unresolved symbol: ' + item.ident); } @@ -1571,6 +1571,8 @@ function JSify(data, functionsOnly, givenFunctions) { } } + if (abortExecution) throw 'Aborting compilation due to previous warnings'; + if (phase == 'pre' || phase == 'funcs') { PassManager.serialize(); return; diff --git a/src/utility.js b/src/utility.js index 19444675..b67e6c21 100644 --- a/src/utility.js +++ b/src/utility.js @@ -85,6 +85,13 @@ function warnOnce(a, msg) { } } +var abortExecution = false; + +function error(msg) { + abortExecution = true; + printErr('Error: ' + msg); +} + function dedup(items, ident) { var seen = {}; if (ident) { |