ASSERT when paused in debugger and console evaluation causes exception
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2019 00:39:45 +0000 (00:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jan 2019 00:39:45 +0000 (00:39 +0000)
commite74f62aea4d7e5daaf30155baaa9234c664518e5
tree65e3ea42d660d865829afec8acfca68af862644a
parent0919c8dd975b53b9b5793ea44357faf53c292f1f
ASSERT when paused in debugger and console evaluation causes exception
https://bugs.webkit.org/show_bug.cgi?id=193246

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-08
Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/VM.cpp:
(JSC::VM::throwException):
Improve assertion to allow for the debugger's evaluate on call frame condition.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::callFrameAtDebuggerEntry const):
(JSC::JSGlobalObject::setCallFrameAtDebuggerEntry):
Debugger call frame only used by assertions.

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* debugger/DebuggerEvalEnabler.h:
(JSC::DebuggerEvalEnabler::DebuggerEvalEnabler):
(JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler):
When evaluating on a call frame, set a debug GlobalObject state.

LayoutTests:

* inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html:
Correct a typo.

* inspector/debugger/evaluateOnCallFrame-exception-expected.txt: Added.
* inspector/debugger/evaluateOnCallFrame-exception.html: Added.
New test that would have asserted before.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html
LayoutTests/inspector/debugger/evaluateOnCallFrame-exception-expected.txt [new file with mode: 0644]
LayoutTests/inspector/debugger/evaluateOnCallFrame-exception.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/VM.cpp