mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #1691 - Part 16: Dynamically imported modules can throw any value as an exception. https://bugzilla.mozilla.org/show_bug.cgi?id=1508672
(cherry picked from commit 910a37b53f1826a863cc3ab6eb61fc369f4505a0)
This commit is contained in:
parent
f2b179156b
commit
1ac1e90b6a
1 changed files with 1 additions and 7 deletions
|
|
@ -4266,16 +4266,10 @@ AbortDynamicModuleImport(JSContext* cx, unsigned argc, Value* vp)
|
|||
return ReportArgumentTypeError(cx, args[2], "PromiseObject");
|
||||
}
|
||||
|
||||
if (!args[3].isObject() || !args[3].toObject().is<ErrorObject>()) {
|
||||
return ReportArgumentTypeError(cx, args[3], "ErrorObject");
|
||||
}
|
||||
|
||||
RootedString specifier(cx, args[1].toString());
|
||||
Rooted<PromiseObject*> promise(cx, &args[2].toObject().as<PromiseObject>());
|
||||
Rooted<ErrorObject*> error(cx, &args[3].toObject().as<ErrorObject>());
|
||||
|
||||
Rooted<Value> value(cx, ObjectValue(*error));
|
||||
cx->setPendingException(value);
|
||||
cx->setPendingException(args[3]);
|
||||
return js::FinishDynamicModuleImport(cx, args[0], specifier, promise);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue