Skip to content

Commit b280116

Browse files
authored
Avoid using String.replaceAll at compile time. NFC (#19314)
This requires node v15, and we still support running on older versions. See #19280
1 parent 344f077 commit b280116

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ jobs:
577577
other.test_gen_struct_info
578578
other.test_native_call_before_init
579579
other.test_node_unhandled_rejection
580+
other.test_full_js_library
580581
core2.test_hello_world"
581582
# Run a few test with the most recent version of node
582583
# In particular we have some tests that require node flags on older

src/library_async.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mergeInto(LibraryManager.library, {
3838
#if ASYNCIFY_DEBUG
3939
dbg('asyncify instrumenting imports');
4040
#endif
41-
var importPatterns = [{{{ ASYNCIFY_IMPORTS.map(x => new RegExp('^' + x.split('.')[1].replaceAll('*', '.*') + '$')) }}}];
41+
var importPatterns = [{{{ ASYNCIFY_IMPORTS.map(x => '/^' + x.split('.')[1].replace(new RegExp('\\*', 'g'), '.*') + '$/') }}}];
4242

4343
for (var x in imports) {
4444
(function(x) {

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8666,7 +8666,7 @@ def test(check, extra):
86668666
self.assertNotContained(WARNING, proc.stderr)
86678667

86688668
def test_full_js_library(self):
8669-
self.run_process([EMCC, test_file('hello_world.c'), '-sSTRICT_JS', '-sINCLUDE_FULL_LIBRARY'])
8669+
self.run_process([EMCC, test_file('hello_world.c'), '-sSTRICT_JS', '-sINCLUDE_FULL_LIBRARY', '-sASYNCIFY'])
86708670

86718671
def test_full_js_library_undefined(self):
86728672
create_file('main.c', 'void foo(); int main() { foo(); return 0; }')

0 commit comments

Comments
 (0)