Skip to content

Commit

Permalink
Fix git conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Dec 14, 2024
1 parent 8671674 commit 78bf58a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,9 @@ def check_expected_size_in_file(self, desc, filename, size):
expected_size = int(read_file(filename).strip())
delta = size - expected_size
ratio = abs(delta) / float(expected_size)
print(' seen %s size: %d (expected: %d) (delta: %d), ratio to expected: %f' % (desc, size, expected_size, delta, ratio))
print(
' seen %s size: %d (expected: %d) (delta: %d), ratio to expected: %f' % (desc, size, expected_size, delta, ratio)
)
self.assertLess(ratio, size_slack)

library_cache: Dict[str, Tuple[str, object]] = {}
Expand Down
4 changes: 1 addition & 3 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5753,9 +5753,7 @@ def test_small_js_flags(self):
print('size:', size)
# Note that this size includes test harness additions (for reporting the result, etc.).
if not self.is_wasm64() and not self.is_2gb():
self.check_expected_size_in_file('js',
test_file('browser/test_small_js_flags.js.size'),
size)
self.check_expected_size_in_file('js', test_file('browser/test_small_js_flags.js.size'), size)

# Tests that it is possible to initialize and render WebGL content in a
# pthread by using OffscreenCanvas.
Expand Down
1 change: 1 addition & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -3321,6 +3321,7 @@ def test_extern_prepost(self):
'emitDCEGraph3': (['emitDCEGraph', '--no-print'],),
'emitDCEGraph4': (['emitDCEGraph', '--no-print'],),
'emitDCEGraph5': (['emitDCEGraph', '--no-print'],),
'emitDCEGraph-scopes': (['emitDCEGraph', '--no-print'],),
'minimal-runtime-applyDCEGraphRemovals': (['applyDCEGraphRemovals'],),
'applyDCEGraphRemovals': (['applyDCEGraphRemovals'],),
'applyImportAndExportNameChanges': (['applyImportAndExportNameChanges'],),
Expand Down
12 changes: 6 additions & 6 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ def phase_linker_setup(options, state, newargs): # noqa: C901, PLR0912, PLR0915
if 'MODULARIZE' in user_settings:
exit_with_error('EXPORT_ES6 requires MODULARIZE to be set')
settings.MODULARIZE = 1
if shared.target_environment_may_be('node') and not settings.USE_ES6_IMPORT_META:
if settings.ENVIRONMENT_MAY_BE_NODE and not settings.USE_ES6_IMPORT_META:
# EXPORT_ES6 + ENVIRONMENT=*node* requires the use of import.meta.url
if 'USE_ES6_IMPORT_META' in user_settings:
exit_with_error('EXPORT_ES6 and ENVIRONMENT=*node* requires USE_ES6_IMPORT_META to be set')
Expand Down Expand Up @@ -1850,7 +1850,7 @@ def get_full_import_name(name):
if settings.NODE_CODE_CACHING:
if settings.WASM_ASYNC_COMPILATION:
exit_with_error('NODE_CODE_CACHING requires sync compilation (WASM_ASYNC_COMPILATION=0)')
if not shared.target_environment_may_be('node'):
if not settings.ENVIRONMENT_MAY_BE_NODE:
exit_with_error('NODE_CODE_CACHING only works in node, but target environments do not include it')
if settings.SINGLE_FILE:
exit_with_error('NODE_CODE_CACHING saves a file on the side and is not compatible with SINGLE_FILE')
Expand Down Expand Up @@ -2458,11 +2458,11 @@ def phase_binaryen(target, options, wasm_target):


def node_es6_imports():
if not settings.EXPORT_ES6 or not shared.target_environment_may_be('node'):
if not settings.EXPORT_ES6 or not settings.ENVIRONMENT_MAY_BE_NODE:
return ''

# Multi-environment builds uses `await import` in `shell.js`
if shared.target_environment_may_be('web'):
if settings.ENVIRONMENT_MAY_BE_WEB:
return ''

# Use static import declaration if we only target Node.js
Expand All @@ -2488,7 +2488,7 @@ def modularize():

# Multi-environment ES6 builds require an async function
async_emit = ''
if settings.EXPORT_ES6 and shared.target_environment_may_be('node') and shared.target_environment_may_be('web'):
if settings.EXPORT_ES6 and settings.ENVIRONMENT_MAY_BE_NODE and settings.ENVIRONMENT_MAY_BE_WEB:
async_emit = 'async '

# TODO: Remove when https://bugs.webkit.org/show_bug.cgi?id=223533 is resolved.
Expand Down Expand Up @@ -2536,7 +2536,7 @@ def modularize():
script_url = 'import.meta.url'
else:
script_url = "typeof document != 'undefined' ? document.currentScript?.src : undefined"
if shared.target_environment_may_be('node'):
if settings.ENVIRONMENT_MAY_BE_NODE:
script_url_node = "if (typeof __filename != 'undefined') _scriptName = _scriptName || __filename;"
if settings.MODULARIZE == 'instance':
src = '''%(node_imports)s
Expand Down

0 comments on commit 78bf58a

Please sign in to comment.