Changeset 53192 in webkit
- Timestamp:
- Jan 13, 2010 10:14:16 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53191 r53192 1 2010-01-13 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Timothy Hatcher. 4 5 Some objects in the global scope are not completed 6 https://bugs.webkit.org/show_bug.cgi?id=19119 7 8 Use Object.getOwnPropertyNames instead of for-in to provide completions, since 9 Object.getOwnPropertyNames reports both enumerable and non-enumerable properties. 10 11 * inspector/front-end/InjectedScript.js: 12 (InjectedScript._getPropertyNames): 13 (InjectedScript.getCompletions): 14 1 15 2010-01-13 Ben Murdoch <benm@google.com> 2 16 -
trunk/WebCore/inspector/front-end/InjectedScript.js
r52556 r53192 534 534 } 535 535 536 InjectedScript._getPropertyNames = function(object, resultSet) 537 { 538 for (var o = object; o; o = o.__proto__) { 539 try { 540 var names = Object.getOwnPropertyNames(o); 541 for (var i = 0; i < names.length; ++i) 542 resultSet[names[i]] = true; 543 } catch (e) { 544 } 545 } 546 } 547 536 548 InjectedScript.getCompletions = function(expression, includeInspectorCommandLineAPI, callFrameId) 537 549 { … … 549 561 // Evaluate into properties in scope of the selected call frame. 550 562 var scopeChain = callFrame.scopeChain; 551 for (var i = 0; i < scopeChain.length; ++i) { 552 var scopeObject = scopeChain[i]; 553 try { 554 for (var propertyName in scopeObject) 555 props[propertyName] = true; 556 } catch (e) { 557 } 558 } 563 for (var i = 0; i < scopeChain.length; ++i) 564 InjectedScript._getPropertyNames(scopeChain[i], props); 559 565 } 560 566 } else { … … 563 569 expressionResult = InjectedScript._evaluateOn(InjectedScript._window().eval, InjectedScript._window(), expression); 564 570 } 565 if (expressionResult) 566 for (var prop in expressionResult) 567 props[prop] = true; 571 if (typeof expressionResult == "object") 572 InjectedScript._getPropertyNames(expressionResult, props); 568 573 if (includeInspectorCommandLineAPI) 569 574 for (var prop in InjectedScript._window().console._inspectorCommandLineAPI)
Note: See TracChangeset
for help on using the changeset viewer.