diff --git a/src/jsifier.js b/src/jsifier.js index fe02502e20d7..50a8256cc33a 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -98,7 +98,8 @@ function getTransitiveDeps(symbol) { } function shouldPreprocess(fileName) { - return read(fileName).trim().startsWith('#preprocess\n'); + var content = read(fileName).trim() + return content.startsWith('#preprocess\n') || content.startsWith('#preprocess\r\n'); } function preJS() { diff --git a/test/test_other.py b/test/test_other.py index 8b1387159e00..acc284d42c1b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14472,6 +14472,7 @@ def test_wasm64_no_asan(self): err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMEMORY64', '-fsanitize=address']) self.assertContained('error: MEMORY64 does not yet work with ASAN', err) + @crossplatform def test_js_preprocess_pre_post(self): create_file('pre.js', ''' #preprocess