Ignore:
Timestamp:
Jan 31, 2012, 3:24:55 PM (13 years ago)
Author:
[email protected]
Message:

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

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

Original patch by Juan Carlos Montemayor Elosua:

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.

Modified to be correct on ToT, with a variety of correctness,
performance, and security improvements.

(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:

Reviewed by Gavin Barraclough

Original patch by Juan Carlos Montemayor Elosua.

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
Note: See TracChangeset for help on using the changeset viewer.