Ignore:
Timestamp:
Sep 27, 2011, 10:58:55 AM (14 years ago)
Author:
[email protected]
Message:

Implement Error.stack
https://bugs.webkit.org/show_bug.cgi?id=66994

Patch by Juan Carlos Montemayor Elosua <[email protected]> on 2011-09-27
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

This patch utilizes topCallFrame to create a stack trace when
an error is thrown. Users will also be able to use the stack()
command in jsc to get arrays with stack trace information.

(JSC::getCallerLine):
(JSC::getSourceURLFromCallFrame):
(JSC::getStackFrameCodeType):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::throwException):

  • interpreter/Interpreter.h:

(JSC::StackFrame::toString):

  • jsc.cpp:

(GlobalObject::finishCreation):
(functionJSCStack):

  • parser/Parser.h:

(JSC::Parser::parse):

  • runtime/CommonIdentifiers.h:
  • runtime/Error.cpp:

(JSC::addErrorInfo):

  • runtime/Error.h:

LayoutTests:

Unit tests that contain both normal and special cases for stack trace
generation.

  • fast/js/exception-properties-expected.txt:
  • fast/js/script-tests/exception-properties.js:
  • fast/js/script-tests/stack-trace.js: Added.

(printStack):
(hostThrower):
(callbacker):
(outer):
(inner):
(evaler):
(normalOuter):
(normalInner):
(scripterInner):
(scripterOuter):

  • fast/js/stack-trace-expected.txt: Added.
  • fast/js/stack-trace.html: Added.
  • platform/chromium/test_expectations.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r96045 r96131  
    115115__ZN3JSC10throwErrorEPNS_9ExecStateENS_7JSValueE
    116116__ZN3JSC10throwErrorEPNS_9ExecStateEPNS_8JSObjectE
     117__ZN3JSC11Interpreter13getStackTraceEPNS_12JSGlobalDataEiRN3WTF6VectorINS_10StackFrameELm0EEE
    117118__ZN3JSC11JSByteArray13s_defaultInfoE
    118119__ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueEPKNS_9ClassInfoE
Note: See TracChangeset for help on using the changeset viewer.