diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2023-03-04 18:50:27 -0800 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2023-03-04 23:40:32 -0800 |
commit | aa12b498290e96dfbb36156ed0e73d432e8378c2 (patch) | |
tree | 47d42058ecfba2a12f2a8ecada60dc01fdc7d446 | |
parent | 92ec9c84334406a32cfd97767efd6a12a5409a79 (diff) | |
download | gjs-aa12b498290e96dfbb36156ed0e73d432e8378c2.tar.gz |
context: Use correct debug tag with promise reaction function
The reaction functions of the module evaluation promise accidentally had
their function IDs switched, leading to potential confusion when
debugging: a function called "async reject" would be called when the
module evaluation promise resolved, and vice versa.
-rw-r--r-- | gjs/context.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gjs/context.cpp b/gjs/context.cpp index 94a45c8b..f9787017 100644 --- a/gjs/context.cpp +++ b/gjs/context.cpp @@ -565,12 +565,12 @@ static bool add_promise_reactions(JSContext* cx, JS::HandleValue promise, JS::RootedFunction on_rejected( cx, - js::NewFunctionWithReserved(cx, reject, 1, 0, resolved_tag.c_str())); + js::NewFunctionWithReserved(cx, reject, 1, 0, rejected_tag.c_str())); if (!on_rejected) return false; JS::RootedFunction on_resolved( cx, - js::NewFunctionWithReserved(cx, resolve, 1, 0, rejected_tag.c_str())); + js::NewFunctionWithReserved(cx, resolve, 1, 0, resolved_tag.c_str())); if (!on_resolved) return false; |