Bug 1820119 - import() should throw a TypeError in a worklet script. r=jonco,yulia
Differential Revision: https://phabricator.services.mozilla.com/D171563
This commit is contained in:
@@ -318,7 +318,10 @@ bool ModuleLoaderBase::HostImportModuleDynamically(
|
||||
aCx, uri, script, aReferencingPrivate, specifierString, aPromise);
|
||||
|
||||
if (!request) {
|
||||
JS_ReportErrorASCII(aCx, "Dynamic import not supported in this context");
|
||||
// Throws TypeError if CreateDynamicImport returns nullptr.
|
||||
JS_ReportErrorNumberASCII(aCx, js::GetErrorMessage, nullptr,
|
||||
JSMSG_DYNAMIC_IMPORT_NOT_SUPPORTED);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user