| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4a6ca7a commit 25c79f3
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -800,19 +800,16 @@ static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args, | |||
| 800 | 800 | return ExitCode::kInvalidCommandLineArgument2; | |
| 801 | 801 | } | |
| 802 | 802 | ||
| 803 | - // TODO(aduh95): remove this when the harmony-import-assertions flag | ||
| 804 | - // is removed in V8. | ||
| 805 | - if (std::find(v8_args.begin(), v8_args.end(), | ||
| 806 | - "--no-harmony-import-assertions") == v8_args.end()) { | ||
| 807 | - v8_args.emplace_back("--harmony-import-assertions"); | ||
| 808 | - } | ||
| 809 | 803 | // TODO(aduh95): remove this when the harmony-import-attributes flag | |
| 810 | 804 | // is removed in V8. | |
| 811 | 805 | if (std::find(v8_args.begin(), | |
| 812 | 806 | v8_args.end(), | |
| 813 | 807 | "--no-harmony-import-attributes") == v8_args.end()) { | |
| 814 | 808 | v8_args.emplace_back("--harmony-import-attributes"); | |
| 815 | 809 | } | |
| 810 | + // TODO(nicolo-ribaudo): remove this once V8 doesn't enable it by default | ||
| 811 | + // anymore. | ||
| 812 | + v8_args.emplace_back("--no-harmony-import-assertions"); | ||
| 816 | 813 | ||
| 817 | 814 | auto env_opts = per_process::cli_options->per_isolate->per_env; | |
| 818 | 815 | if (std::find(v8_args.begin(), v8_args.end(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,16 @@ async function test() { | |||
| 55 | 55 | import(jsonModuleDataUrl, { with: { type: 'unsupported' } }), | |
| 56 | 56 | { code: 'ERR_IMPORT_ATTRIBUTE_UNSUPPORTED' } | |
| 57 | 57 | ); | |
| 58 | + | ||
| 59 | + await rejects( | ||
| 60 | + import(jsonModuleDataUrl, { assert: { type: 'json' } }), | ||
| 61 | + { code: 'ERR_IMPORT_ATTRIBUTE_MISSING' } | ||
| 62 | + ); | ||
| 63 | + | ||
| 64 | + await rejects( | ||
| 65 | + import(`data:text/javascript,import${JSON.stringify(jsonModuleDataUrl)}assert{type:"json"}`), | ||
| 66 | + SyntaxError | ||
| 67 | + ); | ||
| 58 | 68 | } | |
| 59 | 69 | ||
| 60 | 70 | test().then(common.mustCall()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,3 +50,13 @@ await rejects( | |||
| 50 | 50 | import(jsonModuleDataUrl, { with: { type: 'unsupported' } }), | |
| 51 | 51 | { code: 'ERR_IMPORT_ATTRIBUTE_UNSUPPORTED' } | |
| 52 | 52 | ); | |
| 53 | + | ||
| 54 | + await rejects( | ||
| 55 | + import(jsonModuleDataUrl, { assert: { type: 'json' } }), | ||
| 56 | + { code: 'ERR_IMPORT_ATTRIBUTE_MISSING' } | ||
| 57 | + ); | ||
| 58 | + | ||
| 59 | + await rejects( | ||
| 60 | + import(`data:text/javascript,import${JSON.stringify(jsonModuleDataUrl)}assert{type:"json"}`), | ||
| 61 | + SyntaxError | ||
| 62 | + ); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments