OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 ObjectUI.JavaScriptAutocomplete = {}; | 5 ObjectUI.JavaScriptAutocomplete = {}; |
6 | 6 |
7 /** @typedef {{title:(string|undefined), items:Array<string>}} */ | 7 /** @typedef {{title:(string|undefined), items:Array<string>}} */ |
8 ObjectUI.JavaScriptAutocomplete.CompletionGroup; | 8 ObjectUI.JavaScriptAutocomplete.CompletionGroup; |
9 | 9 |
10 /** | 10 /** |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 false /* accessorPropertiesOnly */, false /* generatePreview */, | 320 false /* accessorPropertiesOnly */, false /* generatePreview */, |
321 propertiesCollected.bind(null, scope.typeName())); | 321 propertiesCollected.bind(null, scope.typeName())); |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 /** | 325 /** |
326 * @param {?SDK.RemoteObject} result | 326 * @param {?SDK.RemoteObject} result |
327 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails | 327 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails |
328 */ | 328 */ |
329 function receivedPropertyNamesFromEval(result, exceptionDetails) { | 329 function receivedPropertyNamesFromEval(result, exceptionDetails) { |
330 executionContext.target().runtimeModel.releaseObjectGroup('completion'); | 330 executionContext.runtimeModel.releaseObjectGroup('completion'); |
331 if (result && !exceptionDetails) | 331 if (result && !exceptionDetails) |
332 receivedPropertyNames(/** @type {!Object} */ (result.value)); | 332 receivedPropertyNames(/** @type {!Object} */ (result.value)); |
333 else | 333 else |
334 fulfill([]); | 334 fulfill([]); |
335 } | 335 } |
336 | 336 |
337 /** | 337 /** |
338 * @param {?Object} object | 338 * @param {?Object} object |
339 */ | 339 */ |
340 function receivedPropertyNames(object) { | 340 function receivedPropertyNames(object) { |
341 executionContext.target().runtimeModel.releaseObjectGroup('completion'); | 341 executionContext.runtimeModel.releaseObjectGroup('completion'); |
342 if (!object) { | 342 if (!object) { |
343 fulfill([]); | 343 fulfill([]); |
344 return; | 344 return; |
345 } | 345 } |
346 var propertyGroups = /** @type {!Array<!ObjectUI.JavaScriptAutocomplete.Comp
letionGroup>} */ (object); | 346 var propertyGroups = /** @type {!Array<!ObjectUI.JavaScriptAutocomplete.Comp
letionGroup>} */ (object); |
347 var includeCommandLineAPI = (!dotNotation && !bracketNotation); | 347 var includeCommandLineAPI = (!dotNotation && !bracketNotation); |
348 if (includeCommandLineAPI) { | 348 if (includeCommandLineAPI) { |
349 const commandLineAPI = [ | 349 const commandLineAPI = [ |
350 'dir', | 350 'dir', |
351 'dirxml', | 351 'dirxml', |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 function itemComparator(naturalOrder, a, b) { | 460 function itemComparator(naturalOrder, a, b) { |
461 var aStartsWithUnderscore = a.startsWith('_'); | 461 var aStartsWithUnderscore = a.startsWith('_'); |
462 var bStartsWithUnderscore = b.startsWith('_'); | 462 var bStartsWithUnderscore = b.startsWith('_'); |
463 if (aStartsWithUnderscore && !bStartsWithUnderscore) | 463 if (aStartsWithUnderscore && !bStartsWithUnderscore) |
464 return 1; | 464 return 1; |
465 if (bStartsWithUnderscore && !aStartsWithUnderscore) | 465 if (bStartsWithUnderscore && !aStartsWithUnderscore) |
466 return -1; | 466 return -1; |
467 return naturalOrder ? String.naturalOrderComparator(a, b) : a.localeCompare(
b); | 467 return naturalOrder ? String.naturalOrderComparator(a, b) : a.localeCompare(
b); |
468 } | 468 } |
469 }; | 469 }; |
OLD | NEW |