Ignore:
Timestamp:
Feb 22, 2014, 9:44:05 PM (12 years ago)
Author:
[email protected]
Message:

REGRESSION (r164507): Crash beneath JSGlobalObjectInspectorController::reportAPIException at facebook.com, twitter.com, youtube.com
https://bugs.webkit.org/show_bug.cgi?id=129227

Reviewed by Eric Carlson.

Reverted r164507.

Source/JavaScriptCore:

  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeError):
(JSObjectMakeRegExp):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):

  • API/JSValue.mm:

(valueToArray):
(valueToDictionary):

  • API/JSValueRef.cpp:

(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueCreateJSONString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):

  • inspector/ConsoleMessage.cpp:

(Inspector::ConsoleMessage::ConsoleMessage):
(Inspector::ConsoleMessage::autogenerateMetadata):

  • inspector/ConsoleMessage.h:
  • inspector/JSGlobalObjectInspectorController.cpp:

(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):

  • inspector/JSGlobalObjectInspectorController.h:
  • inspector/ScriptCallStack.cpp:
  • inspector/ScriptCallStack.h:
  • inspector/ScriptCallStackFactory.cpp:

(Inspector::createScriptCallStack):
(Inspector::createScriptCallStackForConsole):
(Inspector::createScriptCallStackFromException):

  • inspector/ScriptCallStackFactory.h:
  • inspector/agents/InspectorConsoleAgent.cpp:

(Inspector::InspectorConsoleAgent::enable):
(Inspector::InspectorConsoleAgent::addMessageToConsole):
(Inspector::InspectorConsoleAgent::count):

  • inspector/agents/JSGlobalObjectDebuggerAgent.cpp:

(Inspector::JSGlobalObjectDebuggerAgent::breakpointActionLog):

Source/WebCore:

  • bindings/js/JSDOMBinding.cpp:

(WebCore::reportException):

  • inspector/InspectorResourceAgent.cpp:

(WebCore::InspectorResourceAgent::buildInitiatorObject):

  • inspector/PageDebuggerAgent.cpp:

(WebCore::PageDebuggerAgent::breakpointActionLog):

  • inspector/TimelineRecordFactory.cpp:

(WebCore::TimelineRecordFactory::createGenericRecord):

  • page/Console.cpp:

(WebCore::internalAddMessage):
(WebCore::Console::profile):
(WebCore::Console::profileEnd):
(WebCore::Console::timeEnd):

  • page/ContentSecurityPolicy.cpp:

(WebCore::gatherSecurityPolicyViolationEventData):
(WebCore::ContentSecurityPolicy::reportViolation):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::postMessage):

Source/WebInspectorUI:

  • UserInterface/Views/ConsoleMessageImpl.js:

(WebInspector.ConsoleMessageImpl.prototype._formatMessage):
(WebInspector.ConsoleMessageImpl.prototype._populateStackTraceTreeElement):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r164507 r164554  
    5656#include "RegExpConstructor.h"
    5757
    58 #if ENABLE(REMOTE_INSPECTOR)
    59 #include "JSGlobalObjectInspectorController.h"
    60 #endif
    61 
    6258using namespace JSC;
    6359
     
    150146    JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, sourceURL->string(), TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber::first()));
    151147    if (exec->hadException()) {
    152         JSValue exceptionValue = exec->exception();
    153         if (exception)
    154             *exception = toRef(exec, exceptionValue);
    155         exec->clearException();
    156 #if ENABLE(REMOTE_INSPECTOR)
    157         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    158 #endif
     148        if (exception)
     149            *exception = toRef(exec, exec->exception());
     150        exec->clearException();
    159151        result = 0;
    160152    }
     
    182174
    183175    if (exec->hadException()) {
    184         JSValue exceptionValue = exec->exception();
    185         if (exception)
    186             *exception = toRef(exec, exceptionValue);
    187         exec->clearException();
    188 #if ENABLE(REMOTE_INSPECTOR)
    189         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    190 #endif
     176        if (exception)
     177            *exception = toRef(exec, exec->exception());
     178        exec->clearException();
    191179        result = 0;
    192180    }
     
    210198    JSObject* result = constructDate(exec, exec->lexicalGlobalObject(), argList);
    211199    if (exec->hadException()) {
    212         JSValue exceptionValue = exec->exception();
    213         if (exception)
    214             *exception = toRef(exec, exceptionValue);
    215         exec->clearException();
    216 #if ENABLE(REMOTE_INSPECTOR)
    217         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    218 #endif
     200        if (exception)
     201            *exception = toRef(exec, exec->exception());
     202        exec->clearException();
    219203        result = 0;
    220204    }
     
    237221
    238222    if (exec->hadException()) {
    239         JSValue exceptionValue = exec->exception();
    240         if (exception)
    241             *exception = toRef(exec, exceptionValue);
    242         exec->clearException();
    243 #if ENABLE(REMOTE_INSPECTOR)
    244         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    245 #endif
     223        if (exception)
     224            *exception = toRef(exec, exec->exception());
     225        exec->clearException();
    246226        result = 0;
    247227    }
     
    265245    JSObject* result = constructRegExp(exec, exec->lexicalGlobalObject(),  argList);
    266246    if (exec->hadException()) {
    267         JSValue exceptionValue = exec->exception();
    268         if (exception)
    269             *exception = toRef(exec, exceptionValue);
    270         exec->clearException();
    271 #if ENABLE(REMOTE_INSPECTOR)
    272         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    273 #endif
     247        if (exception)
     248            *exception = toRef(exec, exec->exception());
     249        exec->clearException();
    274250        result = 0;
    275251    }
     
    333309    JSValue jsValue = jsObject->get(exec, propertyName->identifier(&exec->vm()));
    334310    if (exec->hadException()) {
    335         JSValue exceptionValue = exec->exception();
    336         if (exception)
    337             *exception = toRef(exec, exceptionValue);
    338         exec->clearException();
    339 #if ENABLE(REMOTE_INSPECTOR)
    340         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    341 #endif
     311        if (exception)
     312            *exception = toRef(exec, exec->exception());
     313        exec->clearException();
    342314    }
    343315    return toRef(exec, jsValue);
     
    366338
    367339    if (exec->hadException()) {
    368         JSValue exceptionValue = exec->exception();
    369         if (exception)
    370             *exception = toRef(exec, exceptionValue);
    371         exec->clearException();
    372 #if ENABLE(REMOTE_INSPECTOR)
    373         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    374 #endif
     340        if (exception)
     341            *exception = toRef(exec, exec->exception());
     342        exec->clearException();
    375343    }
    376344}
     
    389357    JSValue jsValue = jsObject->get(exec, propertyIndex);
    390358    if (exec->hadException()) {
    391         JSValue exceptionValue = exec->exception();
    392         if (exception)
    393             *exception = toRef(exec, exceptionValue);
    394         exec->clearException();
    395 #if ENABLE(REMOTE_INSPECTOR)
    396         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    397 #endif
     359        if (exception)
     360            *exception = toRef(exec, exec->exception());
     361        exec->clearException();
    398362    }
    399363    return toRef(exec, jsValue);
     
    415379    jsObject->methodTable()->putByIndex(jsObject, exec, propertyIndex, jsValue, false);
    416380    if (exec->hadException()) {
    417         JSValue exceptionValue = exec->exception();
    418         if (exception)
    419             *exception = toRef(exec, exceptionValue);
    420         exec->clearException();
    421 #if ENABLE(REMOTE_INSPECTOR)
    422         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    423 #endif
     381        if (exception)
     382            *exception = toRef(exec, exec->exception());
     383        exec->clearException();
    424384    }
    425385}
     
    438398    bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->vm()));
    439399    if (exec->hadException()) {
    440         JSValue exceptionValue = exec->exception();
    441         if (exception)
    442             *exception = toRef(exec, exceptionValue);
    443         exec->clearException();
    444 #if ENABLE(REMOTE_INSPECTOR)
    445         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    446 #endif
     400        if (exception)
     401            *exception = toRef(exec, exec->exception());
     402        exec->clearException();
    447403    }
    448404    return result;
     
    586542    JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
    587543    if (exec->hadException()) {
    588         JSValue exceptionValue = exec->exception();
    589         if (exception)
    590             *exception = toRef(exec, exceptionValue);
    591         exec->clearException();
    592 #if ENABLE(REMOTE_INSPECTOR)
    593         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    594 #endif
     544        if (exception)
     545            *exception = toRef(exec, exec->exception());
     546        exec->clearException();
    595547        result = 0;
    596548    }
     
    627579    JSObjectRef result = toRef(construct(exec, jsObject, constructType, constructData, argList));
    628580    if (exec->hadException()) {
    629         JSValue exceptionValue = exec->exception();
    630         if (exception)
    631             *exception = toRef(exec, exceptionValue);
    632         exec->clearException();
    633 #if ENABLE(REMOTE_INSPECTOR)
    634         exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
    635 #endif
     581        if (exception)
     582            *exception = toRef(exec, exec->exception());
     583        exec->clearException();
    636584        result = 0;
    637585    }
Note: See TracChangeset for help on using the changeset viewer.