diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-18 11:08:18 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-18 11:08:18 -0700 |
commit | 855894f1724ae372ff4b64a6a4805564397422b6 (patch) | |
tree | 218a150ce0f4c30cf4517517b75c8f2fe8b8acbe | |
parent | 1c0c65eda4a71509de627b271f38d4349296f0ac (diff) |
do not warn/error on unresolved symbols that have been declared dead
-rw-r--r-- | src/jsifier.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index bc89b0c4..5c718c09 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -512,11 +512,13 @@ function JSify(data, functionsOnly, givenFunctions) { } else if (LibraryManager.library.hasOwnProperty(shortident)) { item.JS = addFromLibrary(shortident); } else if (!LibraryManager.library.hasOwnProperty(shortident + '__inline')) { - 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.'; - } else if (WARN_ON_UNDEFINED_SYMBOLS) { - warn('Unresolved symbol: ' + item.ident); + if (!(item.ident in DEAD_FUNCTIONS)) { + 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.'; + } else if (WARN_ON_UNDEFINED_SYMBOLS) { + warn('Unresolved symbol: ' + item.ident); + } } } return ret; |