Skip to content

Commit a83bbfe

Browse files
committed
address @sbc100 review
1 parent e2b3fc9 commit a83bbfe

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/file_packager.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,11 @@ def main(): # noqa: C901, PLR0912, PLR0915
491491
diagnostics.error('TARGET should not be the same value of --js-output')
492492
return 1
493493

494+
if option.from_emcc and options.modularize
495+
diagnostics.error('Can\'t use modularize option together with --from-emcc since the code should be embedded'
496+
'within emcc\'s code')
497+
return 1
498+
494499
walked.append(__file__)
495500
for file_ in data_files:
496501
if not should_ignore(file_.srcpath):
@@ -629,8 +634,7 @@ def generate_js(data_target, data_files, metadata):
629634
else:
630635
if options.modularize:
631636
ret = '''
632-
export default function loadDataFile(moduleArg = {}) {
633-
var Module = moduleArg;
637+
export default function loadDataFile(Module) {
634638
'''
635639

636640
else:
@@ -1171,7 +1175,7 @@ def generate_js(data_target, data_files, metadata):
11711175
}
11721176
loadPackage(%s);\n''' % json.dumps(metadata)
11731177

1174-
if options.modularize and not options.from_emcc:
1178+
if options.modularize:
11751179
ret += '''
11761180
};'''
11771181
else:

0 commit comments

Comments
 (0)