Ignore:
Timestamp:
Jun 17, 2008, 3:33:07 PM (17 years ago)
Author:
[email protected]
Message:

Use accurate call frame title's based on the call frame type.
Added a type to DebuggerCallFrame so the under interface can
distinguish anonymous functions and program call frames.

JavaScriptCore:

2008-06-16 Timothy Hatcher <[email protected]>

Added a type to DebuggerCallFrame so the under interface can
distinguish anonymous functions and program call frames.

https://bugs.webkit.org/show_bug.cgi?id=19585

Reviewed by Geoff Garen.

  • JavaScriptCore.exp: Export the DebuggerCallFrame::type symbol.
  • kjs/DebuggerCallFrame.cpp: (KJS::DebuggerCallFrame::type): Added.
  • kjs/DebuggerCallFrame.h:

WebCore:

2008-06-16 Timothy Hatcher <[email protected]>

Use accurate call frame title's based on the call frame type.

https://bugs.webkit.org/show_bug.cgi?id=19585

Reviewed by Geoff Garen.

  • English.lproj/localizedStrings.js: Updated strings.
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::evaluate): Removed the isValid() check since the evaluate() functiondoes the check already. (WebCore::JSJavaScriptCallFrame::thisObject): Removed the isValid() check, since thisObject() does the check and returns null if invalid. (WebCore::JSJavaScriptCallFrame::type): Return a string based on the enum value of the type. (WebCore::JSJavaScriptCallFrame::scopeChain): Removed the isValid() check, since scopeChain() does the check and returns null if invalid. So just null check scopeChain().
  • page/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::type): Return the DebuggerCallFrame::Type. Return DebuggerCallFrame::UnknownType if the call frame is invalid.
  • page/JavaScriptCallFrame.h:
  • page/JavaScriptCallFrame.idl: Add the type property.
  • page/inspector/CallStackSidebarPane.js: (WebInspector.CallStackSidebarPane.prototype.update): Check the type of the call frame to create the correct title.
  • page/inspector/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype._addScriptToFilesMenu): Use the "(program)" title for the file menu to match the call frames.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/DebuggerCallFrame.cpp

    r34581 r34634  
    5353}
    5454
     55DebuggerCallFrame::Type DebuggerCallFrame::type() const
     56{
     57    if (m_registerOffset == 0)
     58        return ProgramType;
     59
     60    int callFrameOffset = m_registerOffset - m_codeBlock->numLocals - Machine::CallFrameHeaderSize;
     61    ASSERT(callFrameOffset >= 0);
     62
     63    Register* callFrame = *m_registerBase + callFrameOffset;
     64    if (callFrame[Machine::Callee].u.jsObject)
     65        return FunctionType;
     66
     67    return ProgramType;
     68}
     69
    5570JSObject* DebuggerCallFrame::thisObject() const
    5671{
Note: See TracChangeset for help on using the changeset viewer.