@@ -3298,45 +3298,34 @@ def test_module_exports_with_closure(self):
3298
3298
# This is important as if module.export is not present the Module
3299
3299
# object will not be visible to node.js
3300
3300
3301
- # compile with -O2 --closure 0
3302
- self.run_process([EMCC, test_file('Module-exports/test.c'),
3303
- '-o', 'test.js', '-O2', '--closure', '0',
3304
- '--pre-js', test_file('Module-exports/setup.js'),
3301
+ # compile without --closure=1
3302
+ self.run_process([EMCC, test_file('module_exports/test.c'),
3303
+ '-o', 'test.js', '-O2',
3305
3304
'-sEXPORTED_FUNCTIONS=_bufferTest,_malloc,_free',
3306
3305
'-sEXPORTED_RUNTIME_METHODS=ccall,cwrap',
3307
3306
'-sWASM_ASYNC_COMPILATION=0'])
3308
3307
3309
- # Check that compilation was successful
3310
- self.assertExists('test.js')
3311
- test_js_closure_0 = read_file('test.js')
3312
-
3313
- # Check that test.js compiled with --closure 0 contains "module['exports'] = Module;"
3314
- assert ("module['exports'] = Module;" in test_js_closure_0) or ('module["exports"]=Module' in test_js_closure_0) or ('module["exports"] = Module;' in test_js_closure_0)
3308
+ # Check that test.js compiled without --closure=1 contains "module['exports'] = Module;"
3309
+ self.assertContained('module["exports"]=Module', read_file('test.js'))
3315
3310
3316
3311
# Check that main.js (which requires test.js) completes successfully when run in node.js
3317
3312
# in order to check that the exports are indeed functioning correctly.
3318
- shutil.copyfile(test_file('Module-exports /main.js'), 'main.js')
3313
+ shutil.copyfile(test_file('module_exports /main.js'), 'main.js')
3319
3314
self.assertContained('bufferTest finished', self.run_js('main.js'))
3320
3315
3321
3316
# Delete test.js again and check it's gone.
3322
3317
delete_file('test.js')
3323
- self.assertNotExists('test.js')
3324
3318
3325
- # compile with -O2 -- closure 1
3326
- self.run_process([EMCC, test_file('Module-exports /test.c'),
3319
+ # compile with -- closure= 1
3320
+ self.run_process([EMCC, test_file('module_exports /test.c'),
3327
3321
'-o', 'test.js', '-O2', '--closure=1',
3328
- '--pre-js', test_file('Module-exports/setup.js'),
3329
3322
'-sEXPORTED_FUNCTIONS=_bufferTest,_malloc,_free',
3330
3323
'-sEXPORTED_RUNTIME_METHODS=ccall,cwrap',
3331
3324
'-sWASM_ASYNC_COMPILATION=0'])
3332
3325
3333
- # Check that compilation was successful
3334
- self.assertExists('test.js')
3335
- test_js_closure_1 = read_file('test.js')
3336
-
3337
3326
# Check that test.js compiled with --closure 1 contains "module.exports", we want to verify that
3338
3327
# "module['exports']" got minified to "module.exports" when compiling with --closure 1
3339
- self.assertContained(" module.exports", test_js_closure_1 )
3328
+ self.assertContained(' module.exports=', read_file('test.js') )
3340
3329
3341
3330
# Check that main.js (which requires test.js) completes successfully when run in node.js
3342
3331
# in order to check that the exports are indeed functioning correctly.
@@ -3591,7 +3580,6 @@ def test_proxyfs(self):
3591
3580
3592
3581
create_file('proxyfs_pre.js', r'''
3593
3582
Module["noInitialRun"]=true;
3594
- Module["noExitRuntime"]=true;
3595
3583
''')
3596
3584
3597
3585
create_file('proxyfs_embed.txt', 'test\n')
@@ -7406,7 +7394,7 @@ def test(page_diff):
7406
7394
self.assertEqual(less, none)
7407
7395
7408
7396
@parameterized({
7409
- 'normal ': (['-sWASM_BIGINT=0' ], 'testbind.js'),
7397
+ '': ([], 'testbind.js'),
7410
7398
'bigint': (['-sWASM_BIGINT'], 'testbind_bigint.js'),
7411
7399
})
7412
7400
@requires_node
0 commit comments