Skip to content

Commit 2626ed8

Browse files
committed
Fix #preprocess detection on windows
Followup to #21227
1 parent c47d060 commit 2626ed8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/jsifier.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ function getTransitiveDeps(symbol) {
9898
}
9999

100100
function shouldPreprocess(fileName) {
101-
return read(fileName).trim().startsWith('#preprocess\n');
101+
var content = read(fileName).trim()
102+
return content.startsWith('#preprocess\n') || content.startsWith('#preprocess\r\n')
102103
}
103104

104105
function preJS() {

test/test_other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14472,6 +14472,7 @@ def test_wasm64_no_asan(self):
1447214472
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMEMORY64', '-fsanitize=address'])
1447314473
self.assertContained('error: MEMORY64 does not yet work with ASAN', err)
1447414474

14475+
@crossplatform
1447514476
def test_js_preprocess_pre_post(self):
1447614477
create_file('pre.js', '''
1447714478
#preprocess

0 commit comments

Comments
 (0)