Ignore:
Timestamp:
Feb 22, 2014, 9:44:05 PM (11 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/JSValue.mm

    r164507 r164554  
    2121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    2222 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    2424 */
    2525
     
    4848#import <wtf/text/StringHash.h>
    4949
    50 #if ENABLE(REMOTE_INSPECTOR)
    51 #import "CallFrame.h"
    52 #import "JSGlobalObject.h"
    53 #import "JSGlobalObjectInspectorController.h"
    54 #endif
    55 
    5650#if JSC_OBJC_API_ENABLED
    5751
     
    635629    return last;
    636630}
    637 
    638 #if ENABLE(REMOTE_INSPECTOR)
    639 static void reportExceptionToInspector(JSGlobalContextRef context, JSC::JSValue exception)
    640 {
    641     JSC::ExecState* exec = toJS(context);
    642     exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exception);
    643 }
    644 #endif
    645631
    646632static JSContainerConvertor::Task valueToObjectWithoutCopy(JSGlobalContextRef context, JSValueRef value)
     
    796782
    797783    JSC::APIEntryShim shim(toJS(context));
    798     if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) {
    799         JSC::JSObject* exceptionObject = JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSArray"));
    800         *exception = toRef(exceptionObject);
    801 #if ENABLE(REMOTE_INSPECTOR)
    802         reportExceptionToInspector(context, exceptionObject);
    803 #endif
    804     }
     784    if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value)))
     785        *exception = toRef(JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSArray")));
    805786    return nil;
    806787}
     
    818799
    819800    JSC::APIEntryShim shim(toJS(context));
    820     if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value))) {
    821         JSC::JSObject* exceptionObject = JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSDictionary"));
    822         *exception = toRef(exceptionObject);
    823 #if ENABLE(REMOTE_INSPECTOR)
    824         reportExceptionToInspector(context, exceptionObject);
    825 #endif
    826     }
     801    if (!(JSValueIsNull(context, value) || JSValueIsUndefined(context, value)))
     802        *exception = toRef(JSC::createTypeError(toJS(context), ASCIILiteral("Cannot convert primitive to NSDictionary")));
    827803    return nil;
    828804}
Note: See TracChangeset for help on using the changeset viewer.