diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /js/src/debugger/Frame.cpp | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/debugger/Frame.cpp')
-rw-r--r-- | js/src/debugger/Frame.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/debugger/Frame.cpp b/js/src/debugger/Frame.cpp index 9767e2e7ed..63978b90ab 100644 --- a/js/src/debugger/Frame.cpp +++ b/js/src/debugger/Frame.cpp @@ -439,6 +439,24 @@ void DebuggerFrame::terminate(JS::GCContext* gcx, AbstractFramePtr frame) { gcx->delete_(this, info, MemoryUse::DebuggerFrameGeneratorInfo); } +void DebuggerFrame::onGeneratorClosed(JS::GCContext* gcx) { + GeneratorInfo* info = generatorInfo(); + + // If the generator is closed, eagerly drop the onStep handler, to make sure + // the stepper counter matches in the assertion in DebugAPI::onSingleStep. + // Also clear the slot in order to suppress the decrementStepperCounter in + // DebuggerFrame::terminate. + if (!info->isGeneratorScriptAboutToBeFinalized()) { + JSScript* generatorScript = info->generatorScript(); + OnStepHandler* handler = onStepHandler(); + if (handler) { + decrementStepperCounter(gcx, generatorScript); + setReservedSlot(ONSTEP_HANDLER_SLOT, UndefinedValue()); + handler->drop(gcx, this); + } + } +} + void DebuggerFrame::suspend(JS::GCContext* gcx) { // There must be generator info because otherwise this would be the same // overall behavior as terminate() except that here we do not properly |