Selaa lähdekoodia

LibJS: Don't return empty value from PromiseReactionJob::call(), for now

Linus Groh 3 vuotta sitten
vanhempi
commit
2ffb30a996
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp

+ 3 - 1
Userland/Libraries/LibJS/Runtime/PromiseJobs.cpp

@@ -53,7 +53,9 @@ Value PromiseReactionJob::call()
 
     if (!promise_capability.has_value()) {
         dbgln_if(PROMISE_DEBUG, "[PromiseReactionJob @ {}]: Reaction has no PromiseCapability, returning empty value", this);
-        return {};
+        // TODO: This can't return an empty value at the moment, because the implicit conversion to Completion would fail.
+        //       Change it back when this is using completions (`return normal_completion({})`)
+        return js_undefined();
     }
 
     if (vm.exception()) {