diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index fac35f53ea6b32b7fe653d477c38791a5404777c..855426c26766b957ab593e22ad085873098f79f1 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,19 @@ +2011-09-27 Sheriff Bot + + Unreviewed, rolling out r96131. + http://trac.webkit.org/changeset/96131 + https://bugs.webkit.org/show_bug.cgi?id=68927 + + It made 18+ tests crash on all platform (Requested by + Ossy_night on #webkit). + + * fast/js/exception-properties-expected.txt: + * fast/js/script-tests/exception-properties.js: + * fast/js/script-tests/stack-trace.js: Removed. + * fast/js/stack-trace-expected.txt: Removed. + * fast/js/stack-trace.html: Removed. + * platform/chromium/test_expectations.txt: + 2011-06-28 Robert Hogan Reviewed by David Hyatt. diff --git a/LayoutTests/fast/js/exception-properties-expected.txt b/LayoutTests/fast/js/exception-properties-expected.txt index 2a5cb8174e0e8c365ec8318d7f28c1cbdfe2f316..36d7e84b1ed08e2be161b2ae54daf51d3225595e 100644 --- a/LayoutTests/fast/js/exception-properties-expected.txt +++ b/LayoutTests/fast/js/exception-properties-expected.txt @@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE PASS enumerableProperties(error) is [] -PASS enumerableProperties(nativeError) is ["line", "sourceId", "sourceURL", "jscStack"] +PASS enumerableProperties(nativeError) is ["line", "sourceId", "sourceURL"] PASS Object.getPrototypeOf(nativeError).name is "RangeError" PASS Object.getPrototypeOf(nativeError).message is "" PASS successfullyParsed is true diff --git a/LayoutTests/fast/js/script-tests/exception-properties.js b/LayoutTests/fast/js/script-tests/exception-properties.js index 16926b349149ddd8c314854fda41bfba8ec59ef2..4a2a102280df0fc3e3518df7e82e5cf026fa751c 100644 --- a/LayoutTests/fast/js/script-tests/exception-properties.js +++ b/LayoutTests/fast/js/script-tests/exception-properties.js @@ -16,7 +16,7 @@ try { var error = new Error("message"); shouldBe('enumerableProperties(error)', '[]'); - shouldBe('enumerableProperties(nativeError)', '["line", "sourceId", "sourceURL", "jscStack"]'); + shouldBe('enumerableProperties(nativeError)', '["line", "sourceId", "sourceURL"]'); shouldBe('Object.getPrototypeOf(nativeError).name', '"RangeError"'); shouldBe('Object.getPrototypeOf(nativeError).message', '""'); diff --git a/LayoutTests/fast/js/script-tests/stack-trace.js b/LayoutTests/fast/js/script-tests/stack-trace.js deleted file mode 100644 index fa68c819991f6715ed88b800045ada17f58933e7..0000000000000000000000000000000000000000 --- a/LayoutTests/fast/js/script-tests/stack-trace.js +++ /dev/null @@ -1,42 +0,0 @@ -description( -'This test checks stack trace corectness in special cases.' -); - -function printStack(stackTrace) { - debug("--> Stack Trace:") - var i = 0; - for (var level in stackTrace) { - debug(" " + i + " " + stackTrace[level].substring(0, stackTrace[level].indexOf('file:')) + stackTrace[level].substring(stackTrace[level].lastIndexOf('/')+1)); - i++; - } - debug(''); -} - -function hostThrower() { Element.prototype.appendChild.call({ }, [{ }]); } -function callbacker(f) { [0].map(f); } -function outer(errorName) { inner(errorName); } -function inner(errorName) { throw new Error("Error in " + errorName); } -function evaler(code) { eval(code); } -function normalOuter() { normalInner(); } -function normalInner() { if(thisVarDoesntExist) failIfTrue("shouldFailBeforeThis") }; -function scripterInner() { htmlInner(); } -function scripterOuter() { htmlOuter(); } - // Expected functions in stack trace -// Normal Case -try { normalOuter() } catch (e) { printStack(e.jscStack) } // normalOuter -> normalInner - -// Eval Case -try { evaler("inner('inner eval');"); } catch (e) { printStack(e.jscStack) } // evaler -> eval -> inner -try { evaler("outer('outer eval');"); } catch (e) { printStack(e.jscStack) } // evaler -> eval -> outer -> inner - -// Function Callback Case -try { callbacker(inner('inner map')); } catch (e) { printStack(e.jscStack); } // callbacker -> map -> inner -try { callbacker(outer('outer map')); } catch (e) { printStack(e.jscStack); } // callbacker -> map -> outer -> inner - -// Host Code Case -try { hostThrower(); } catch (e) { printStack(e.jscStack); } // hostThrower - -try { scripterInner(); } catch (e) { printStack(e.jscStack) } // program -> scripter -> inner -try { scripterOuter(); } catch (e) { printStack(e.jscStack) } // program -> scripter -> outer -> inner - -successfullyParsed = true; diff --git a/LayoutTests/fast/js/stack-trace-expected.txt b/LayoutTests/fast/js/stack-trace-expected.txt deleted file mode 100644 index 9174ca7a3d77f19ad5642493ebd8da5c0800b483..0000000000000000000000000000000000000000 --- a/LayoutTests/fast/js/stack-trace-expected.txt +++ /dev/null @@ -1,48 +0,0 @@ -This test checks stack trace corectness in special cases. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - ---> Stack Trace: - 0 normalInner at stack-trace.js:21 - 1 normalOuter at stack-trace.js:20 - 2 at stack-trace.js:26 - ---> Stack Trace: - 0 inner at stack-trace.js:18 - 1 eval - 2 evaler at stack-trace.js - 3 at stack-trace.js:29 - ---> Stack Trace: - 0 inner at stack-trace.js:18 - 1 outer at stack-trace.js:17 - 2 eval - 3 evaler at stack-trace.js - 4 at stack-trace.js:30 - ---> Stack Trace: - 0 inner at stack-trace.js:18 - 1 at stack-trace.js:33 - ---> Stack Trace: - 0 inner at stack-trace.js:18 - 1 outer at stack-trace.js:17 - 2 at stack-trace.js:34 - ---> Stack Trace: - 0 hostThrower at stack-trace.js:15 - 1 at stack-trace.js:37 - ---> Stack Trace: - 0 htmlInner at stack-trace.html:10 - 1 scripterInner at stack-trace.js:22 - 2 at stack-trace.js:39 - ---> Stack Trace: - 0 htmlInner at stack-trace.html:10 - 1 htmlOuter at stack-trace.html:11 - 2 scripterOuter at stack-trace.js:23 - 3 at stack-trace.js:40 - - diff --git a/LayoutTests/fast/js/stack-trace.html b/LayoutTests/fast/js/stack-trace.html deleted file mode 100644 index e08c910bf0ad8209ae0a85e228a283c9c14a0549..0000000000000000000000000000000000000000 --- a/LayoutTests/fast/js/stack-trace.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -

-

- - - - - diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt index 13958b741f89b6bfa297027fd90dc026e8ec7f78..a25e24683349041a56cd23a8ddd51a2ac7fb2e14 100644 --- a/LayoutTests/platform/chromium/test_expectations.txt +++ b/LayoutTests/platform/chromium/test_expectations.txt @@ -489,10 +489,6 @@ WONTFIX SKIP : fast/frames/cross-site-this.html = FAIL // throw. V8 follows the spec. WONTFIX SKIP : fast/js/reparsing-semicolon-insertion.html = FAIL -// This tests stack-traces that are generated by JSC. This test should -// fail since it is specific to jsc. -WONTFIX SKIP : fast/js/stack-trace.html = FAIL - // Rubber-banding is currently a CG only feature. WONTFIX CPU GPU : platform/chromium/rubberbanding = FAIL WONTFIX CPU GPU : platform/chromium-gpu/compositing/rubberbanding = IMAGE diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index 50eedb43420206a564395acf1d1bece5c6ddfaa8..4a7ba4820acc551911eac170f4db1b3343ab79e0 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,26 @@ +2011-09-27 Sheriff Bot + + Unreviewed, rolling out r96131. + http://trac.webkit.org/changeset/96131 + https://bugs.webkit.org/show_bug.cgi?id=68927 + + It made 18+ tests crash on all platform (Requested by + Ossy_night on #webkit). + + * JavaScriptCore.exp: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * interpreter/Interpreter.cpp: + (JSC::Interpreter::throwException): + * interpreter/Interpreter.h: + * jsc.cpp: + (GlobalObject::finishCreation): + * parser/Parser.h: + (JSC::Parser::parse): + * runtime/CommonIdentifiers.h: + * runtime/Error.cpp: + (JSC::addErrorInfo): + * runtime/Error.h: + 2011-09-27 Mark Hahnenberg De-virtualize JSCell::getPrimitiveNumber diff --git a/Source/JavaScriptCore/JavaScriptCore.exp b/Source/JavaScriptCore/JavaScriptCore.exp index d4151a43a580c9e1cb17952366065eef2cb443d6..d7daa8c10667b250c65a5e9a149e2fdb0f0aaeb0 100644 --- a/Source/JavaScriptCore/JavaScriptCore.exp +++ b/Source/JavaScriptCore/JavaScriptCore.exp @@ -114,7 +114,6 @@ __ZN3JSC10JSFunction6s_infoE __ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureE __ZN3JSC10throwErrorEPNS_9ExecStateENS_7JSValueE __ZN3JSC10throwErrorEPNS_9ExecStateEPNS_8JSObjectE -__ZN3JSC11Interpreter13getStackTraceEPNS_12JSGlobalDataEiRN3WTF6VectorINS_10StackFrameELm0EEE __ZN3JSC11JSByteArray13s_defaultInfoE __ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueEPKNS_9ClassInfoE __ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def index e750590faba008d749527c5f12b83461ed545ea9..cc0977f1a25ecc15fe77b43254134a8f19ec02ad 100644 --- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def +++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def @@ -208,7 +208,6 @@ EXPORTS ?getPropertyDescriptor@JSObject@JSC@@QAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z ?getPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z ?getSlice@ArgList@JSC@@QBEXHAAV12@@Z - ?getStackTrace@Interpreter@JSC@@SAXPAVJSGlobalData@2@HAAV?$Vector@UStackFrame@JSC@@$0A@@WTF@@@Z ?getString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z ?getString@JSCell@JSC@@QBE_NPAVExecState@2@AAVUString@2@@Z ?getter@PropertyDescriptor@JSC@@QBE?AVJSValue@2@XZ diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp index da49469fe1346533c6da78af3f8def54d0e22d13..9f0aa30dfb6cb9efcc471c5019912a040ff1c2df 100644 --- a/Source/JavaScriptCore/interpreter/Interpreter.cpp +++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp @@ -45,6 +45,7 @@ #include "JSActivation.h" #include "JSArray.h" #include "JSByteArray.h" +#include "JSFunction.h" #include "JSNotAnObject.h" #include "JSPropertyNameIterator.h" #include "LiteralParser.h" @@ -686,88 +687,6 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, exception->putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message)); } -static void getCallerLine(JSGlobalData* globalData, CallFrame* callFrame, int& lineNumber) -{ - (void)globalData; - unsigned bytecodeOffset; - lineNumber = -1; - callFrame = callFrame->removeHostCallFrameFlag(); - - if (callFrame->callerFrame() == CallFrame::noCaller() || callFrame->callerFrame()->hasHostCallFrameFlag()) - return; - - CodeBlock* callerCodeBlock = callFrame->callerFrame()->removeHostCallFrameFlag()->codeBlock(); - -#if ENABLE(INTERPRETER) - if (!globalData->canUseJIT()) - bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnVPC()); -#if ENABLE(JIT) - else - bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC()); -#endif -#else - bytecodeOffset = callerCodeBlock->bytecodeOffset(callFrame->returnPC()); -#endif - - lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(bytecodeOffset - 1); -} - -static ALWAYS_INLINE const UString getSourceURLFromCallFrame(CallFrame* callFrame) -{ - if (callFrame->hasHostCallFrameFlag()) - return UString(); -#if ENABLE(INTERPRETER) - if (!callFrame->globalData().canUseJIT()) - return callFrame->codeBlock()->source()->url(); -#if ENABLE(JIT) - return callFrame->codeBlock()->ownerExecutable()->sourceURL(); -#endif -#else - return callFrame->codeBlock()->ownerExecutable()->sourceURL(); -#endif -} - -static StackFrameCodeType getStackFrameCodeType(CallFrame* callFrame) -{ - if (callFrame->hasHostCallFrameFlag()) - return StackFrameNativeCode; - - switch (callFrame->codeBlock()->codeType()) { - case EvalCode: - return StackFrameEvalCode; - case FunctionCode: - return StackFrameFunctionCode; - case GlobalCode: - return StackFrameGlobalCode; - } - ASSERT_NOT_REACHED(); - return StackFrameGlobalCode; -} - -void Interpreter::getStackTrace(JSGlobalData* globalData, int line, Vector& results) -{ - int stackLimit = 15; - CallFrame* callFrame = globalData->topCallFrame->removeHostCallFrameFlag(); - if (!callFrame || callFrame == CallFrame::noCaller() || !callFrame->codeBlock()) - return; - UString sourceURL; - UString traceLevel; - - for (int i = 0; i < stackLimit; ++i) { - if (!callFrame || callFrame == CallFrame::noCaller()) - break; - if (callFrame->codeBlock()) { - sourceURL = getSourceURLFromCallFrame(callFrame); - - StackFrame s = { Strong(*globalData, callFrame->callee()), Strong(*globalData, callFrame), getStackFrameCodeType(callFrame), Strong(*globalData, callFrame->codeBlock()->ownerExecutable()), line, sourceURL}; - - results.append(s); - } - getCallerLine(globalData, callFrame, line); - callFrame = callFrame->callerFrame()->removeHostCallFrameFlag(); - } -} - NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSValue& exceptionValue, unsigned bytecodeOffset) { CodeBlock* codeBlock = callFrame->codeBlock(); @@ -786,9 +705,7 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV // FIXME: should only really be adding these properties to VM generated exceptions, // but the inspector currently requires these for all thrown objects. - Vector stackTrace; - getStackTrace(&callFrame->globalData(), codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), stackTrace); - addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), codeBlock->ownerExecutable()->source(), stackTrace); + addErrorInfo(callFrame, exception, codeBlock->lineNumberForBytecodeOffset(bytecodeOffset), codeBlock->ownerExecutable()->source()); } isInterrupt = isInterruptedExecutionException(exception) || isTerminatedExecutionException(exception); diff --git a/Source/JavaScriptCore/interpreter/Interpreter.h b/Source/JavaScriptCore/interpreter/Interpreter.h index f3365a7bf7664c89da0bcbcc612b9dfd7cc08530..fd7f624e4237d15beb97145313a201a3c9ca0e6b 100644 --- a/Source/JavaScriptCore/interpreter/Interpreter.h +++ b/Source/JavaScriptCore/interpreter/Interpreter.h @@ -31,7 +31,6 @@ #include "ArgList.h" #include "JSCell.h" -#include "JSFunction.h" #include "JSValue.h" #include "JSObject.h" #include "Opcode.h" @@ -43,8 +42,8 @@ namespace JSC { class CodeBlock; class EvalExecutable; - class ExecutableBase; class FunctionExecutable; + class JSFunction; class JSGlobalObject; class ProgramExecutable; class Register; @@ -63,56 +62,6 @@ namespace JSC { WillExecuteStatement }; - enum StackFrameCodeType { - StackFrameGlobalCode, - StackFrameEvalCode, - StackFrameFunctionCode, - StackFrameNativeCode - }; - - struct StackFrame { - Strong callee; - Strong callFrame; - StackFrameCodeType codeType; - Strong executable; - int line; - UString sourceURL; - UString toString() const - { - bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty(); - bool hasLineInfo = line > -1; - String traceLine; - JSObject* stackFrameCallee = callee.get(); - - switch (codeType) { - case StackFrameEvalCode: - if (hasSourceURLInfo) - traceLine = hasLineInfo ? String::format("eval at %s:%d", sourceURL.ascii().data(), line) - : String::format("eval at %s", sourceURL.ascii().data()); - else - traceLine = String::format("eval"); - break; - case StackFrameNativeCode: - traceLine = "Native code"; - break; - case StackFrameFunctionCode: - if (stackFrameCallee && stackFrameCallee->inherits(&JSFunction::s_info)) { - UString functionName = asFunction(stackFrameCallee)->name(callFrame.get()); - if (hasSourceURLInfo) - traceLine = hasLineInfo ? String::format("%s at %s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line) - : String::format("%s at %s", functionName.ascii().data(), sourceURL.ascii().data()); - else - traceLine = String::format("%s\n", functionName.ascii().data()); - break; - } - case StackFrameGlobalCode: - traceLine = hasLineInfo ? String::format("at %s:%d", sourceURL.ascii().data(), line) - : String::format("at %s", sourceURL.ascii().data()); - } - return traceLine.impl(); - } - }; - class TopCallFrameSetter { public: TopCallFrameSetter(JSGlobalData& global, CallFrame* callFrame) @@ -179,8 +128,6 @@ namespace JSC { NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset); NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset); NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine); - static const UString getTraceLine(CallFrame*, StackFrameCodeType, const UString&, int); - static void getStackTrace(JSGlobalData*, int line, Vector& results); void dumpSampleData(ExecState* exec); void startSampling(); diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp index ca522a48570ee808502d697a12846d300a05f2d0..9b753e2c969d77f7e9c46813e960683eff1bbd3b 100644 --- a/Source/JavaScriptCore/jsc.cpp +++ b/Source/JavaScriptCore/jsc.cpp @@ -27,7 +27,6 @@ #include "CurrentTime.h" #include "ExceptionHelpers.h" #include "InitializeThreading.h" -#include "Interpreter.h" #include "JSArray.h" #include "JSFunction.h" #include "JSLock.h" @@ -74,7 +73,6 @@ static bool fillBufferWithContentsOfFile(const UString& fileName, Vector& static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState*); static EncodedJSValue JSC_HOST_CALL functionDebug(ExecState*); -static EncodedJSValue JSC_HOST_CALL functionJSCStack(ExecState*); static EncodedJSValue JSC_HOST_CALL functionGC(ExecState*); #ifndef NDEBUG static EncodedJSValue JSC_HOST_CALL functionReleaseExecutableMemory(ExecState*); @@ -176,7 +174,6 @@ protected: addFunction(globalData, "run", functionRun, 1); addFunction(globalData, "load", functionLoad, 1); addFunction(globalData, "checkSyntax", functionCheckSyntax, 1); - addFunction(globalData, "jscStack", functionJSCStack, 1); addFunction(globalData, "readline", functionReadline, 0); addFunction(globalData, "preciseTime", functionPreciseTime, 0); #if ENABLE(SAMPLING_FLAGS) @@ -224,22 +221,6 @@ EncodedJSValue JSC_HOST_CALL functionDebug(ExecState* exec) return JSValue::encode(jsUndefined()); } -EncodedJSValue JSC_HOST_CALL functionJSCStack(ExecState* exec) -{ - String trace = "--> Stack trace:\n"; - Vector stackTrace; - Interpreter::getStackTrace(&exec->globalData(), -1, stackTrace); - int i = 0; - - for (Vector::iterator iter = stackTrace.begin(); iter < stackTrace.end(); iter++) { - StackFrame level = *iter; - trace += String::format(" %i %s\n", i, level.toString().utf8().data()); - i++; - } - fprintf(stderr, "%s", trace.utf8().data()); - return JSValue::encode(jsUndefined()); -} - EncodedJSValue JSC_HOST_CALL functionGC(ExecState* exec) { JSLock lock(SilenceAssertionsOnly); diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h index cc3a8edfba4c36376570907a4cf79dc13d14f21f..2dbd27cf4e047499cb82316c785ba2d82109584b 100644 --- a/Source/JavaScriptCore/parser/Parser.h +++ b/Source/JavaScriptCore/parser/Parser.h @@ -114,7 +114,7 @@ namespace JSC { else if (isEvalNode()) *exception = createSyntaxError(lexicalGlobalObject, errMsg); else - *exception = addErrorInfo(&lexicalGlobalObject->globalData(), createSyntaxError(lexicalGlobalObject, errMsg), errLine, source, Vector()); + *exception = addErrorInfo(&lexicalGlobalObject->globalData(), createSyntaxError(lexicalGlobalObject, errMsg), errLine, source); } m_arena.reset(); diff --git a/Source/JavaScriptCore/runtime/CommonIdentifiers.h b/Source/JavaScriptCore/runtime/CommonIdentifiers.h index be8ce3ec35ca38282929e16737875dc94c49480f..9ade142f6a0a00671c68f2a5fb7b0c3fda4ce7ff 100644 --- a/Source/JavaScriptCore/runtime/CommonIdentifiers.h +++ b/Source/JavaScriptCore/runtime/CommonIdentifiers.h @@ -52,7 +52,6 @@ macro(input) \ macro(isArray) \ macro(isPrototypeOf) \ - macro(jscStack) \ macro(length) \ macro(message) \ macro(multiline) \ diff --git a/Source/JavaScriptCore/runtime/Error.cpp b/Source/JavaScriptCore/runtime/Error.cpp index c6eb408a92204842f220ce93dbea790c96386367..0081135d981f79e311b776bee5031bae12200c67 100644 --- a/Source/JavaScriptCore/runtime/Error.cpp +++ b/Source/JavaScriptCore/runtime/Error.cpp @@ -26,7 +26,6 @@ #include "ConstructData.h" #include "ErrorConstructor.h" -#include "JSArray.h" #include "JSFunction.h" #include "JSGlobalObject.h" #include "JSObject.h" @@ -117,7 +116,7 @@ JSObject* createURIError(ExecState* exec, const UString& message) return createURIError(exec->lexicalGlobalObject(), message); } -JSObject* addErrorInfo(JSGlobalData* globalData, JSObject* error, int line, const SourceCode& source, const Vector& stackTrace) +JSObject* addErrorInfo(JSGlobalData* globalData, JSObject* error, int line, const SourceCode& source) { intptr_t sourceID = source.provider()->asID(); const UString& sourceURL = source.provider()->url(); @@ -128,21 +127,13 @@ JSObject* addErrorInfo(JSGlobalData* globalData, JSObject* error, int line, cons error->putWithAttributes(globalData, Identifier(globalData, sourceIdPropertyName), jsNumber((double)sourceID), ReadOnly | DontDelete); if (!sourceURL.isNull()) error->putWithAttributes(globalData, Identifier(globalData, sourceURLPropertyName), jsString(globalData, sourceURL), ReadOnly | DontDelete); - if (!stackTrace.isEmpty()) { - JSArray* stackTraceArray = JSArray::create(*globalData, globalData->dynamicGlobalObject->arrayStructure()); - for (unsigned i = 0; i < stackTrace.size(); i++) { - UString stackLevel = stackTrace[i].toString(); - stackTraceArray->push(globalData->topCallFrame, jsString(globalData, stackLevel)); - } - error->putWithAttributes(globalData, globalData->propertyNames->jscStack, stackTraceArray, ReadOnly | DontDelete); - } return error; } -JSObject* addErrorInfo(ExecState* exec, JSObject* error, int line, const SourceCode& source, const Vector& stackTrace) +JSObject* addErrorInfo(ExecState* exec, JSObject* error, int line, const SourceCode& source) { - return addErrorInfo(&exec->globalData(), error, line, source, stackTrace); + return addErrorInfo(&exec->globalData(), error, line, source); } bool hasErrorInfo(ExecState* exec, JSObject* error) diff --git a/Source/JavaScriptCore/runtime/Error.h b/Source/JavaScriptCore/runtime/Error.h index f4a6d8c7312895f19fff39abf6cfc64d91048617..c0f9d32098b1666adf39bdb40d3f84bf100f7d8c 100644 --- a/Source/JavaScriptCore/runtime/Error.h +++ b/Source/JavaScriptCore/runtime/Error.h @@ -23,7 +23,6 @@ #ifndef Error_h #define Error_h -#include "Interpreter.h" #include "JSObject.h" #include @@ -56,9 +55,9 @@ namespace JSC { // Methods to add bool hasErrorInfo(ExecState*, JSObject* error); - JSObject* addErrorInfo(JSGlobalData*, JSObject* error, int line, const SourceCode&, const Vector&); + JSObject* addErrorInfo(JSGlobalData*, JSObject* error, int line, const SourceCode&); // ExecState wrappers. - JSObject* addErrorInfo(ExecState*, JSObject* error, int line, const SourceCode&, const Vector&); + JSObject* addErrorInfo(ExecState*, JSObject* error, int line, const SourceCode&); // Methods to throw Errors. JSValue throwError(ExecState*, JSValue);