diff options
Diffstat (limited to 'Source/JavaScriptCore/debugger')
4 files changed, 28 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp index b999446..64f6002 100644 --- a/Source/JavaScriptCore/debugger/Debugger.cpp +++ b/Source/JavaScriptCore/debugger/Debugger.cpp @@ -29,7 +29,9 @@ #include "Parser.h" #include "Protect.h" -namespace JSC { +namespace { + +using namespace JSC; class Recompiler { public: @@ -82,6 +84,10 @@ inline void Recompiler::operator()(JSCell* cell) m_sourceProviders.add(executable->source().provider(), exec); } +} // namespace + +namespace JSC { + Debugger::~Debugger() { HashSet<JSGlobalObject*>::iterator end = m_globalObjects.end(); @@ -118,16 +124,18 @@ void Debugger::recompileAllJSFunctions(JSGlobalData* globalData) JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSGlobalObject* globalObject) { CallFrame* globalCallFrame = globalObject->globalExec(); + JSGlobalData& globalData = globalObject->globalData(); - RefPtr<EvalExecutable> eval = EvalExecutable::create(globalCallFrame, makeSource(script), false); - JSObject* error = eval->compile(globalCallFrame, globalCallFrame->scopeChain()); - if (error) - return error; + EvalExecutable* eval = EvalExecutable::create(globalCallFrame, makeSource(script), false); + if (!eval) { + exception = globalData.exception; + globalData.exception = JSValue(); + return exception; + } - JSGlobalData& globalData = globalObject->globalData(); - JSValue result = globalData.interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain()); + JSValue result = globalData.interpreter->execute(eval, globalCallFrame, globalObject, globalCallFrame->scopeChain()); if (globalData.exception) { - exception = globalData.exception.get(); + exception = globalData.exception; globalData.exception = JSValue(); } ASSERT(result); diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp index 62a2e54..50ba746 100644 --- a/Source/JavaScriptCore/debugger/DebuggerActivation.cpp +++ b/Source/JavaScriptCore/debugger/DebuggerActivation.cpp @@ -31,7 +31,7 @@ namespace JSC { DebuggerActivation::DebuggerActivation(JSGlobalData& globalData, JSObject* activation) - : JSNonFinalObject(DebuggerActivation::createStructure(jsNull())) + : JSNonFinalObject(DebuggerActivation::createStructure(globalData, jsNull())) { ASSERT(activation); ASSERT(activation->isActivationObject()); diff --git a/Source/JavaScriptCore/debugger/DebuggerActivation.h b/Source/JavaScriptCore/debugger/DebuggerActivation.h index 01a4907..f22d2ff 100644 --- a/Source/JavaScriptCore/debugger/DebuggerActivation.h +++ b/Source/JavaScriptCore/debugger/DebuggerActivation.h @@ -49,9 +49,9 @@ namespace JSC { virtual JSValue lookupGetter(ExecState*, const Identifier& propertyName); virtual JSValue lookupSetter(ExecState*, const Identifier& propertyName); - static PassRefPtr<Structure> createStructure(JSValue prototype) + static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { - return Structure::create(prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); + return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp index d778bd5..08fba4a 100644 --- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp @@ -87,16 +87,17 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c { if (!m_callFrame->codeBlock()) return JSValue(); - - RefPtr<EvalExecutable> eval = EvalExecutable::create(m_callFrame, makeSource(script), m_callFrame->codeBlock()->isStrictMode()); - JSObject* error = eval->compile(m_callFrame, m_callFrame->scopeChain()); - if (error) - return error; - + JSGlobalData& globalData = m_callFrame->globalData(); - JSValue result = globalData.interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain()); + EvalExecutable* eval = EvalExecutable::create(m_callFrame, makeSource(script), m_callFrame->codeBlock()->isStrictMode()); + if (globalData.exception) { + exception = globalData.exception; + globalData.exception = JSValue(); + } + + JSValue result = globalData.interpreter->execute(eval, m_callFrame, thisObject(), m_callFrame->scopeChain()); if (globalData.exception) { - exception = globalData.exception.get(); + exception = globalData.exception; globalData.exception = JSValue(); } ASSERT(result); |