Bug 1628842 reject Worklet#addModule() promise with DOM UnknownError on failure to create global r=baku

The UnknownError is chosen based on
https://heycam.github.io/webidl/#unknownerror and suspected OOM.

Differential Revision: https://phabricator.services.mozilla.com/D71256
This commit is contained in:
Karl Tomlinson 2020-04-17 06:02:16 +00:00
Родитель 0cc43ec735
Коммит b73b39f7a4
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -385,7 +385,10 @@ void ExecutionRunnable::RunOnWorkletThread() {
workletThread->EnsureCycleCollectedJSContext(mParentRuntime);
WorkletGlobalScope* globalScope = mWorkletImpl->GetGlobalScope();
MOZ_ASSERT(globalScope);
if (!globalScope) {
mResult = NS_ERROR_DOM_UNKNOWN_ERR;
return;
}
AutoEntryScript aes(globalScope, "Worklet");
JSContext* cx = aes.cx();