Changeset 37012 in webkit
- Timestamp:
- Sep 27, 2008 3:18:35 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r36999 r37012 1 2008-09-27 Keishi Hattori <casey.hattori@gmail.com> 2 3 Added Machine::retrieveCaller to the export list. 4 5 Reviewed by Kevin McCullough and Tim Hatcher. 6 7 * JavaScriptCore.exp: Added Machine::retrieveCaller. 8 1 9 2008-09-27 Anders Carlsson <andersca@apple.com> 2 10 -
trunk/JavaScriptCore/JavaScriptCore.exp
r36877 r37012 316 316 __ZNK3JSC7JSValue7toFloatEPNS_9ExecStateE 317 317 __ZNK3JSC7JSValue9toIntegerEPNS_9ExecStateE 318 __ZNK3JSC7Machine14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE 318 319 __ZNK3JSC7Machine18retrieveLastCallerEPNS_9ExecStateERiS3_RNS_7UStringERPNS_7JSValueE 319 320 __ZNK3JSC7UString10UTF8StringEb -
trunk/WebCore/ChangeLog
r37008 r37012 1 2008-09-27 Keishi Hattori <casey.hattori@gmail.com> 2 3 Added support for console.trace. 4 5 https://bugs.webkit.org/show_bug.cgi?id=19157 6 7 Reviewed by Kevin McCullough and Tim Hatcher. 8 9 * bindings/js/JSConsoleCustom.cpp: 10 (WebCore::JSConsole::trace): 11 * page/Console.cpp: 12 (WebCore::Console::trace): Calls Machine::retrieveCaller to 13 get a stack trace. 14 * page/Console.h: 15 (WebCore::): Added TraceMessageLevel. 16 * page/Console.idl: Added console.trace. 17 * page/inspector/Console.js: 18 (ConsoleMessage): Added case for TraceMessageLevel. 19 1 20 2008-09-27 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/WebCore/bindings/js/JSConsoleCustom.cpp
r36263 r37012 75 75 } 76 76 77 JSValue* JSConsole::trace(ExecState* exec, const ArgList&) 78 { 79 impl()->trace(exec); 80 return jsUndefined(); 81 } 82 77 83 JSValue* JSConsole::assertCondition(ExecState* exec, const ArgList& arguments) 78 84 { -
trunk/WebCore/page/Console.cpp
r36263 r37012 277 277 } 278 278 279 void Console::trace(ExecState* exec) 280 { 281 Page* page = this->page(); 282 if (!page) 283 return; 284 285 int signedLineNumber; 286 int sourceIdentifer; 287 UString urlString; 288 JSValue* func; 289 290 exec->machine()->retrieveLastCaller(exec, signedLineNumber, sourceIdentifer, urlString, func); 291 292 ArgList args; 293 while (!func->isNull()) { 294 args.append(func); 295 func = exec->machine()->retrieveCaller(exec, static_cast<InternalFunction*>(func)); 296 } 297 298 page->inspectorController()->addMessageToConsole(JSMessageSource, TraceMessageLevel, exec, args, 0, String()); 299 } 300 279 301 void Console::assertCondition(bool condition, ExecState* exec, const ArgList& args) 280 302 { -
trunk/WebCore/page/Console.h
r36263 r37012 62 62 ObjectMessageLevel, 63 63 NodeMessageLevel, 64 TraceMessageLevel, 64 65 StartGroupMessageLevel, 65 66 EndGroupMessageLevel … … 82 83 void dir(JSC::ExecState*, const JSC::ArgList&); 83 84 void dirxml(JSC::ExecState*, const JSC::ArgList& arguments); 85 void trace(JSC::ExecState*); 84 86 void assertCondition(bool condition, JSC::ExecState*, const JSC::ArgList&); 85 87 void count(JSC::ExecState*, const JSC::ArgList&); -
trunk/WebCore/page/Console.idl
r36255 r37012 37 37 [Custom] void dir(); 38 38 [Custom] void dirxml(); 39 [Custom] void trace(); 39 40 [Custom, ImplementationFunction=assertCondition] void assert(in boolean condition); 40 41 [Custom] void count(); -
trunk/WebCore/page/inspector/Console.js
r36958 r37012 576 576 this.repeatCount = repeatCount; 577 577 578 if (this.level === WebInspector.ConsoleMessage.MessageLevel.Object) { 579 var propertiesSection = new WebInspector.ObjectPropertiesSection(arguments[6], null, null, null, true); 580 propertiesSection.element.addStyleClass("console-message"); 581 this.propertiesSection = propertiesSection; 582 } else if (this.level === WebInspector.ConsoleMessage.MessageLevel.Node) { 583 var node = arguments[6]; 584 if (!(node instanceof InspectorController.inspectedWindow().Node)) 585 return; 586 this.elementsTreeOutline = new WebInspector.ElementsTreeOutline(); 587 this.elementsTreeOutline.rootDOMNode = node; 578 switch (this.level) { 579 case WebInspector.ConsoleMessage.MessageLevel.Object: 580 var propertiesSection = new WebInspector.ObjectPropertiesSection(arguments[6], null, null, null, true); 581 propertiesSection.element.addStyleClass("console-message"); 582 this.propertiesSection = propertiesSection; 583 break; 584 case WebInspector.ConsoleMessage.MessageLevel.Node: 585 var node = arguments[6]; 586 if (!(node instanceof InspectorController.inspectedWindow().Node)) 587 return; 588 this.elementsTreeOutline = new WebInspector.ElementsTreeOutline(); 589 this.elementsTreeOutline.rootDOMNode = node; 590 break; 591 case WebInspector.ConsoleMessage.MessageLevel.Trace: 592 var span = document.createElement("span"); 593 span.addStyleClass("console-formatted-trace"); 594 var stack = Array.prototype.slice.call(arguments, 6); 595 var funcNames = stack.map(function(f) { 596 return f.name || WebInspector.UIString("(anonymous function)"); 597 }); 598 span.appendChild(document.createTextNode(funcNames.join("\n"))); 599 this.formattedMessage = span; 600 break; 601 default: 602 // This _format call passes in true for the plainText argument. The result's textContent is 603 // used for inline message bubbles in SourceFrames, or other plain-text representations. 604 this.message = this._format(Array.prototype.slice.call(arguments, 6), true).textContent; 605 606 // The formatedMessage property is used for the rich and interactive console. 607 this.formattedMessage = this._format(Array.prototype.slice.call(arguments, 6)); 608 break; 588 609 } 589 590 // This _format call passes in true for the plainText argument. The result's textContent is591 // used for inline message bubbles in SourceFrames, or other plain-text representations.592 this.message = this._format(Array.prototype.slice.call(arguments, 6), true).textContent;593 594 // The formatedMessage property is used for the rich and interactive console.595 this.formattedMessage = this._format(Array.prototype.slice.call(arguments, 6));596 610 } 597 611 … … 813 827 Object: 4, 814 828 Node: 5, 815 StartGroup: 6, 816 EndGroup: 7 829 Trace: 6, 830 StartGroup: 7, 831 EndGroup: 8 817 832 } 818 833
Note: See TracChangeset
for help on using the changeset viewer.