Changeset 27893 in webkit


Ignore:
Timestamp:
Nov 18, 2007 3:04:19 PM (16 years ago)
Author:
timothy@apple.com
Message:

Reviewed by Sam Weinig.

Bug 16043: Remove InspectorController.log now that console.log works
http://bugs.webkit.org/show_bug.cgi?id=16043

Remove the last uses of InspectorController.log. Once use was no longer needed,
checking an erro case that can't happen anymore. The other case now uses console.error.

  • page/InspectorController.cpp: Remove the log function. (WebCore::InspectorController::windowScriptObjectAvailable): Remove the log function from InspectorController script class.
  • page/inspector/DocumentPanel.js: Remove a use of InspectorController.log that isn't needed.
  • page/inspector/Panel.js: Change InspectorController.log to console.log and early return.
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r27892 r27893  
     12007-11-18  Timothy Hatcher  <timothy@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Bug 16043: Remove InspectorController.log now that console.log works
     6        http://bugs.webkit.org/show_bug.cgi?id=16043
     7
     8        Remove the last uses of InspectorController.log. Once use was no longer needed,
     9        checking an erro case that can't happen anymore. The other case now uses console.error.
     10
     11        * page/InspectorController.cpp: Remove the log function.
     12        (WebCore::InspectorController::windowScriptObjectAvailable): Remove the log function from
     13        InspectorController script class.
     14        * page/inspector/DocumentPanel.js: Remove a use of InspectorController.log that isn't needed.
     15        * page/inspector/Panel.js: Change InspectorController.log to console.log and early return.
     16
    1172007-11-18  Timothy Hatcher  <timothy@apple.com>
    218
  • trunk/WebCore/page/InspectorController.cpp

    r27883 r27893  
    427427}
    428428
    429 static JSValueRef log(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
    430 {
    431     if (argumentCount < 1 || !JSValueIsString(ctx, arguments[0]))
    432         return JSValueMakeUndefined(ctx);
    433 
    434 #ifndef NDEBUG
    435     JSStringRef string = JSValueToStringCopy(ctx, arguments[0], 0);
    436     String message(JSStringGetCharactersPtr(string), JSStringGetLength(string));
    437     JSStringRelease(string);
    438 
    439     fprintf(stderr, "%s\n", message.latin1().data());
    440 #endif
    441 
    442     return JSValueMakeUndefined(ctx);
    443 }
    444 
    445429static JSValueRef search(JSContextRef ctx, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* /*exception*/)
    446430{
     
    747731        { "attach", attach, kJSPropertyAttributeNone },
    748732        { "detach", detach, kJSPropertyAttributeNone },
    749         { "log", log, kJSPropertyAttributeNone },
    750733        { "search", search, kJSPropertyAttributeNone },
    751734#if ENABLE(DATABASE)
  • trunk/WebCore/page/inspector/DocumentPanel.js

    r27883 r27893  
    131131    set focusedDOMNode(x)
    132132    {
    133         if (this.resource.category !== WebInspector.resourceCategories.documents) {
    134             InspectorController.log("Called set focusedDOMNode on a non-document resource " + this.resource.displayName + " which is not a document");
    135             return;
    136         }
    137 
    138133        if (this._focusedDOMNode === x) {
    139134            var nodeItem = this.revealNode(x);
  • trunk/WebCore/page/inspector/Panel.js

    r27883 r27893  
    141141            return;
    142142
     143        if (this !== x.panel) {
     144            console.error("Set currentView to a view " + x.title + " whose panel is not this panel");
     145            return;
     146        }
     147
    143148        if (this._currentView) {
    144149            this._currentView.buttonElement.removeStyleClass("selected");
     
    155160            if (x.show)
    156161                x.show();
    157             if (x.panel !== this)
    158                 InspectorController.log("Set currentView to a view " + x.title + " whose panel is not this panel");
    159162        }
    160163    },
Note: See TracChangeset for help on using the changeset viewer.