Skip to content

Commit

Permalink
Fix 9068 newlines emcc error (emscripten-core#9088)
Browse files Browse the repository at this point in the history
* Fix emscripten-core#9068: get rid of malformed newlines in emcc errors on Windows

This fixes a patch applied to acorn.js for quoting error-causing text
in parse errors (acornjs/acorn#793).
Previously it splitted binary data on \n to get lines, which was
inconsistent with the rest of the parser and caused excess \r in
the error message on Windows. Now it uses the same regex as the rest
of acorn.js (e.g. getLineInfo used by error reporting).

* Fix emscripten-core#9057 by fixing by emscripten-core#9068
  • Loading branch information
yeputons authored and belraquib committed Dec 23, 2020
1 parent 4930a1b commit dee0f92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -8589,7 +8589,6 @@ def test_extern_weak(self):
if not self.is_wasm_backend(): # TODO: wasm backend main module
self.do_other_test(os.path.join('other', 'extern_weak'), emcc_args=['-s', 'MAIN_MODULE=1', '-DLINKABLE'])

@no_windows('https://github.com/emscripten-core/emscripten/issues/9057')
def test_js_optimizer_parse_error(self):
# check we show a proper understandable error for JS parse problems
create_test_file('src.cpp', r'''
Expand All @@ -8608,7 +8607,7 @@ def test_js_optimizer_parse_error(self):
''', '''
var ASM_CONSTS = [function() {var x = !<->5.;}];
^
'''), stderr.replace('\r', ''))
'''), stderr)

def test_EM_ASM_ES6(self):
# check we show a proper understandable error for JS parse problems
Expand Down
2 changes: 1 addition & 1 deletion tools/node_modules/acorn/dist/acorn.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dee0f92

Please sign in to comment.