diff --git a/tools/android-sync.sh b/tools/android-sync.sh index 709bbb7f7d..66d7aed78d 100755 --- a/tools/android-sync.sh +++ b/tools/android-sync.sh @@ -92,15 +92,16 @@ sync_file "$OUTDIR/$ARCH_MODE/snapshot_blob.bin" sync_file "$OUTDIR/$ARCH_MODE/unittests" echo "" echo -n "sync to $ANDROID_V8/tools" -sync_file tools/consarray.js -sync_file tools/codemap.js -sync_file tools/csvparser.js -sync_file tools/profile.js -sync_file tools/splaytree.js -sync_file tools/profile_view.js -sync_file tools/logreader.js -sync_file tools/arguments.js -sync_file tools/tickprocessor.js +sync_file tools/arguments.mjs +sync_file tools/codemap.mjs +sync_file tools/consarray.mjs +sync_file tools/csvparser.mjs +sync_file tools/dumpcpp.mjs +sync_file tools/logreader.mjs +sync_file tools/profile.mjs +sync_file tools/profile_view.mjs +sync_file tools/splaytree.mjs +sync_file tools/tickprocessor.mjs echo "" sync_dir test/intl sync_dir test/message diff --git a/tools/testrunner/objects/testcase.py b/tools/testrunner/objects/testcase.py index 72ca01a421..385bd0f27d 100644 --- a/tools/testrunner/objects/testcase.py +++ b/tools/testrunner/objects/testcase.py @@ -50,12 +50,12 @@ LOAD_PATTERN = re.compile( r"(?:load|readbuffer|read)\((?:'|\")([^'\"]+)(?:'|\")\)") # Pattern to auto-detect files to push on Android for statements like: # import "path/to/file.js" -MODULE_RESOURCES_PATTERN_1 = re.compile( - r"(?:import|export)(?:\(| )(?:'|\")([^'\"]+)(?:'|\")") -# Pattern to auto-detect files to push on Android for statements like: # import foobar from "path/to/file.js" -MODULE_RESOURCES_PATTERN_2 = re.compile( - r"(?:import|export).*from (?:'|\")([^'\"]+)(?:'|\")") +# import {foo, bar} from "path/to/file.js" +# import("module.mjs").catch()... +MODULE_RESOURCES_PATTERN = re.compile( + r"(?:import|export)(?:[^'\"]*?from)?\s*\(?['\"]([^'\"]+)['\"]", + re.MULTILINE | re.DOTALL) TIMEOUT_LONG = "long" @@ -409,12 +409,10 @@ class D8TestCase(TestCase): for match in LOAD_PATTERN.finditer(source): # Files in load statements are relative to base dir. add_path(match.group(1)) - for match in MODULE_RESOURCES_PATTERN_1.finditer(source): + for match in MODULE_RESOURCES_PATTERN.finditer(source): # Imported files are relative to the file importing them. - add_path(os.path.join(os.path.dirname(file), match.group(1))) - for match in MODULE_RESOURCES_PATTERN_2.finditer(source): - # Imported files are relative to the file importing them. - add_path(os.path.join(os.path.dirname(file), match.group(1))) + add_path(os.path.normpath( + os.path.join(os.path.dirname(file), match.group(1)))) return result def _get_resources(self):