Ignore:
Timestamp:
Jan 26, 2009, 3:57:55 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-26 Cameron Zwarich <[email protected]>

Reviewed by Gavin Barraclough.

Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
<https://bugs.webkit.org/show_bug.cgi?id=23552>
<rdar://problem/6398839>

Dashcode will crash when using the evaluator because it saves a global call
frame, even after global code has finished executing, and then uses this as
a launching pad to execute new JS in the evaluator. The fix is to detect
when Dashcode is attempting to do this and execute code from a global call
frame instead.

JavaScriptCore:

  • JavaScriptCore.exp:
  • debugger/Debugger.cpp: (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can evaluate JS starting from a global call frame.
  • debugger/Debugger.h:

WebKit/mac:

  • ForwardingHeaders/runtime/Protect.h: Added.
  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame _initWithGlobalObject:debugger:caller:debuggerCallFrame:]): Added debugger, a WebScriptDebugger* argument. (-[WebScriptCallFrame evaluateWebScript:]): Detect when Dashcode is using a stale WebScriptCallFrame to execute new JS and evaluate it starting from the global object's global call frame instead.
  • WebView/WebScriptDebugger.h: (WebScriptDebugger::globalObject): Added. (WebScriptDebugger::globalCallFrame): Added.
  • WebView/WebScriptDebugger.mm: (WebScriptDebugger::WebScriptDebugger): Initialize m_globalObject. (WebScriptDebugger::initGlobalCallFrame): Created as a clone of callEvent so that the global call frame can be saved immediately after being created. (WebScriptDebugger::callEvent): Pass 'this' as the debugger argument of WebScriptCallFrame's _initWithGlobalObject method.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/debugger/Debugger.h

    r38137 r40274  
    5555    };
    5656
     57    // This method exists only for backwards compatibility with existing
     58    // WebScriptDebugger clients
     59    JSValuePtr evaluateInGlobalCallFrame(const UString&, JSValuePtr& exception, JSGlobalObject*);
     60
    5761} // namespace JSC
    5862
Note: See TracChangeset for help on using the changeset viewer.