v8/test
Sathya Gunasekaran e101b9c03c [parser] Improve error when using import decl in a script
Perform a best-effort check for module context and provide an
appropriate error.

As seen from the import-blah-script.js test, we could have invalid
import expressions in a script context that could result in an error
saying "Cannot use import statement outside a module" which isn't
the ideal error because the error is an incorrect import
expression.

But, when the developer changes to a module context, the
correct error is thrown.

To fix this, we'd have to refactor and call ParseImportDeclaration,
and then throw an appropriate error, which seems like a lot of
overhead for not enough gain.

Bug: v8:9392, v8:6513
Change-Id: I520ebb490fff4d95743a7c751d4095db9a35d41b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1675948
Reviewed-by: Mythri Alle <mythria@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62358}
2019-06-25 12:33:11 +00:00
..
benchmarks
cctest [parser] Improve error when using import decl in a script 2019-06-25 12:33:11 +00:00
common [turbofan] JSHeapBroker logging respects --trace-turbo-filter 2019-06-12 11:02:38 +00:00
debugger [cleanup] Add %PrepareFunctionForOptimize for tests that use %OptimizeOsr 2019-06-18 16:47:29 +00:00
fuzzer [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
inspector [inspector][roheap] Make inspector-test.cc compatible with shared ro-heap 2019-06-25 10:23:49 +00:00
intl Better GetAvilableLocales check resources 2019-06-21 23:04:09 +00:00
js-perf-test [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
memory [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
message [parser] Improve error when using import decl in a script 2019-06-25 12:33:11 +00:00
mjsunit [turbofan] fix bug in CommonOperatorReducer::ReduceReturn 2019-06-25 11:00:01 +00:00
mkgrokdump [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
mozilla Reland "[array] Move Array#sort pre-processing to Torque" 2019-05-24 12:13:17 +00:00
preparser Add OWNERS files for src and test 2019-05-30 04:51:21 +00:00
test262 Remove always-true --harmony-object-from-entries runtime flag 2019-06-24 15:01:01 +00:00
torque [torque] Support 'real' internal classes 2019-06-21 16:09:28 +00:00
unittests [cleanup][ptr-compr][turbofan] DecompressionElimination test cleanup 2019-06-24 21:35:06 +00:00
wasm-api-tests [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
wasm-js [testrunner] generalize test loader to accept multiple extensions 2019-06-25 12:12:11 +00:00
wasm-spec-tests [wasm] Update spec tests 2019-05-22 14:58:45 +00:00
webkit Add quotes around unexpected token SyntaxError 2019-06-11 06:11:58 +00:00
BUILD.gn [wasm-c-api] Add tests and fixes 2019-05-28 09:57:04 +00:00
OWNERS [owners] Make test/ owned by COMMON_OWNERS 2019-06-06 20:56:09 +00:00