Skip to content

Commit 3876665

Browse files
committed
convert False/True to 0/1 when dumping settings
src/settings.js uses 0/1 instead of false/true.
1 parent 80c046e commit 3876665

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

emscripten.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,13 @@ def read_proxied_function_signatures(asmConsts):
582582

583583

584584
def compile_settings(compiler_engine, libraries, temp_files):
585+
settings = shared.Settings.to_dict()
586+
settings.update((key, int(value)) for key, value in settings.items() if isinstance(value, bool))
587+
585588
# Save settings to a file to work around v8 issue 1579
586589
with temp_files.get_file('.txt') as settings_file:
587590
with open(settings_file, 'w') as s:
588-
json.dump(shared.Settings.to_dict(), s, sort_keys=True)
591+
json.dump(settings, s, sort_keys=True)
589592

590593
# Call js compiler
591594
env = os.environ.copy()

tools/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def serialize(self):
11781178
ret = []
11791179
for key, value in self.attrs.items():
11801180
if key == key.upper(): # this is a hack. all of our settings are ALL_CAPS, python internals are not
1181-
jsoned = json.dumps(value, sort_keys=True)
1181+
jsoned = json.dumps(int(value) if isinstance(value, bool) else value, sort_keys=True)
11821182
ret += ['-s', key + '=' + jsoned]
11831183
return ret
11841184

0 commit comments

Comments
 (0)