Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #preprocess detection on windows #21284

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading