Changeset 292830 in webkit for trunk/Source/JavaScriptCore/debugger/Debugger.cpp
- Timestamp:
- Apr 13, 2022, 2:01:19 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r292075 r292830 1036 1036 } 1037 1037 1038 class EmptyTopLevelCallFrameForDebugger { 1039 public: 1040 EmptyTopLevelCallFrameForDebugger(JSGlobalObject* globalObject) 1041 { 1042 CallFrame* callFrame = asCallFrame(); 1043 callFrame->setCodeBlock(nullptr); 1044 callFrame->setCallerFrame(CallFrame::noCaller()); 1045 callFrame->setReturnPC(nullptr); 1046 callFrame->setArgumentCountIncludingThis(1); 1047 callFrame->setThisValue(globalObject->globalThis()); 1048 callFrame->setCallee(globalObject->globalCallee()); 1049 ASSERT(callFrame->isEmptyTopLevelCallFrameForDebugger()); 1050 } 1051 1052 CallFrame* asCallFrame() { return CallFrame::create(m_values); } 1053 1054 private: 1055 Register m_values[CallFrame::headerSizeInRegisters + /* thisValue */ 1] { }; 1056 }; 1057 1038 1058 void Debugger::exception(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue exception, bool hasCatchHandler) 1039 1059 { … … 1057 1077 } 1058 1078 1079 // When callFrame is nullptr, we are throwing an error without JS call frames. 1080 // This can happen when program throws SyntaxError without evaluation. 1081 EmptyTopLevelCallFrameForDebugger emptyCallFrame(globalObject); 1082 bool callFrameWasNull = !callFrame; 1083 if (callFrameWasNull) 1084 callFrame = emptyCallFrame.asCallFrame(); 1085 1059 1086 m_hasHandlerForExceptionCallback = true; 1060 1087 m_currentException = exception; … … 1062 1089 m_currentException = JSValue(); 1063 1090 m_hasHandlerForExceptionCallback = false; 1091 1092 if (callFrameWasNull) 1093 m_currentCallFrame = nullptr; 1064 1094 } 1065 1095
Note:
See TracChangeset
for help on using the changeset viewer.