Skip to content

Commit

Permalink
Bump minimum supported chrome version from 32 to 33 (emscripten-core#…
Browse files Browse the repository at this point in the history
…23077)

This allows us to remove the promise polyfill: https://caniuse.com/promises
  • Loading branch information
sbc100 authored Dec 5, 2024
1 parent a335879 commit 78c968b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 309 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ See docs/process.md for more on how version tagging works.
-----------------------
- The file system was updated to independently track atime, mtime and ctime
instead of using the same time for all three. (#22998)
- The minimum supported chrome version was bumped from 32 to 33. (#23077)

3.1.73 - 11/28/24
-----------------
Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/tools_reference/settings_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ This setting also applies to modern Chromium-based Edge, which shares version
numbers with Chrome.
Chrome 85 was released on 2020-08-25.
MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.
Minimum supported value is 32, which was released on 2014-01-04.
Minimum supported value is 33, which was released on 2014-02-18.

Default value: 85

Expand Down
274 changes: 0 additions & 274 deletions src/polyfill/promise.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ var MIN_SAFARI_VERSION = 140100;
// numbers with Chrome.
// Chrome 85 was released on 2020-08-25.
// MAX_INT (0x7FFFFFFF, or -1) specifies that target is not supported.
// Minimum supported value is 32, which was released on 2014-01-04.
// Minimum supported value is 33, which was released on 2014-02-18.
// [link]
var MIN_CHROME_VERSION = 85;

Expand Down
8 changes: 0 additions & 8 deletions src/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ var Module = typeof {{{ EXPORT_NAME }}} != 'undefined' ? {{{ EXPORT_NAME }}} : {
#endif // USE_CLOSURE_COMPILER

#if POLYFILL
#if ((MAYBE_WASM2JS && WASM != 2) || MODULARIZE) && (MIN_CHROME_VERSION < 33 || MIN_FIREFOX_VERSION < 29 || MIN_SAFARI_VERSION < 80000)
// Include a Promise polyfill for legacy browsers. This is needed either for
// wasm2js, where we polyfill the wasm API which needs Promises, or when using
// modularize which creates a Promise for when the module is ready.
// See https://caniuse.com/#feat=promises
#include "polyfill/promise.js"
#endif

#if MIN_CHROME_VERSION < 45 || MIN_FIREFOX_VERSION < 34 || MIN_SAFARI_VERSION < 90000
// See https://caniuse.com/mdn-javascript_builtins_object_assign
#include "polyfill/objassign.js"
Expand Down
25 changes: 1 addition & 24 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -12427,29 +12427,6 @@ def test_standalone_syscalls(self):
for engine in config.WASM_ENGINES:
self.assertContained(expected, self.run_js('test.wasm', engine))

@parameterized({
'wasm2js': (['-sWASM=0'],),
'modularize': (['-sMODULARIZE', '--extern-post-js', test_file('modularize_post_js.js')],),
})
def test_promise_polyfill(self, constant_args):
def test(args, expect_fail):
# legacy browsers may lack Promise, which wasm2js depends on. see what
# happens when we kill the global Promise function.
self.run_process([EMCC, test_file('hello_world.c')] + constant_args + args)
js = read_file('a.out.js')
create_file('a.out.js', 'Promise = undefined;\n' + js)
return self.run_js('a.out.js', assert_returncode=NON_ZERO if expect_fail else 0)

# we fail without legacy support
test([], expect_fail=True)

# but work with it
output = test(['-sLEGACY_VM_SUPPORT'], expect_fail=False)
self.assertContained('hello, world!', output)

# unless we explicitly disable polyfills
test(['-sLEGACY_VM_SUPPORT', '-sNO_POLYFILL'], expect_fail=True)

@parameterized({
'': ([],),
'assertions': (['-sASSERTIONS'],),
Expand Down Expand Up @@ -15265,7 +15242,7 @@ def test_no_extra_output(self):

def test_browser_too_old(self):
err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sMIN_CHROME_VERSION=10'])
self.assertContained('emcc: error: MIN_CHROME_VERSION older than 32 is not supported', err)
self.assertContained('emcc: error: MIN_CHROME_VERSION older than 33 is not supported', err)

def test_js_only_settings(self):
err = self.run_process([EMCC, test_file('hello_world.c'), '-o', 'foo.wasm', '-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=emscripten_get_heap_max'], stderr=PIPE).stderr
Expand Down
2 changes: 1 addition & 1 deletion tools/feature_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Oldest support browser versions. These have been set somewhat
# arbitrarily for now.
# TODO(sbc): Design a of policy for managing these values.
OLDEST_SUPPORTED_CHROME = 32
OLDEST_SUPPORTED_CHROME = 33
OLDEST_SUPPORTED_FIREFOX = 34
OLDEST_SUPPORTED_SAFARI = 90000
# 10.19.0 is the oldest version of node that we do any testing with.
Expand Down

0 comments on commit 78c968b

Please sign in to comment.