Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(481)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 1685683006: DevTools: [Console] speedup array autocompletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 object = new Boolean(false); 444 object = new Boolean(false);
445 else 445 else
446 object = this; 446 object = this;
447 447
448 var resultSet = {}; 448 var resultSet = {};
449 for (var o = object; o; o = o.__proto__) { 449 for (var o = object; o; o = o.__proto__) {
450 try { 450 try {
451 if (type === "array" && o === object && ArrayBuffer.isVi ew(o) && o.length > 9999) 451 if (type === "array" && o === object && ArrayBuffer.isVi ew(o) && o.length > 9999)
452 continue; 452 continue;
453 var names = Object.getOwnPropertyNames(o); 453 var names = Object.getOwnPropertyNames(o);
454 for (var i = 0; i < names.length; ++i) 454 var isArray = Array.isArray(o);
455 for (var i = 0; i < names.length; ++i) {
456 // Skip array elements indexes.
457 if (isArray && /^[0-9]/.test(names[i]))
458 continue;
455 resultSet[names[i]] = true; 459 resultSet[names[i]] = true;
460 }
456 } catch (e) { 461 } catch (e) {
457 } 462 }
458 } 463 }
459 return resultSet; 464 return resultSet;
460 } 465 }
461 466
462 if (result.type === "object" || result.type === "function") 467 if (result.type === "object" || result.type === "function")
463 result.callFunctionJSON(getCompletions, [WebInspector.RemoteObje ct.toCallArgument(result.subtype)], receivedPropertyNames.bind(this)); 468 result.callFunctionJSON(getCompletions, [WebInspector.RemoteObje ct.toCallArgument(result.subtype)], receivedPropertyNames.bind(this));
464 else if (result.type === "string" || result.type === "number" || res ult.type === "boolean") 469 else if (result.type === "string" || result.type === "number" || res ult.type === "boolean")
465 this.evaluate("(" + getCompletions + ")(\"" + result.type + "\") ", "completion", false, true, true, false, receivedPropertyNamesFromEval.bind(th is)); 470 this.evaluate("(" + getCompletions + ")(\"" + result.type + "\") ", "completion", false, true, true, false, receivedPropertyNamesFromEval.bind(th is));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 /** 686 /**
682 * @param {string} listenerType 687 * @param {string} listenerType
683 */ 688 */
684 setListenerType: function(listenerType) 689 setListenerType: function(listenerType)
685 { 690 {
686 this._listenerType = listenerType; 691 this._listenerType = listenerType;
687 }, 692 },
688 693
689 __proto__: WebInspector.SDKObject.prototype 694 __proto__: WebInspector.SDKObject.prototype
690 } 695 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-completions-on-call-frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698