| 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 WebInspector.JavaScriptAutocomplete = {}; | 5 WebInspector.JavaScriptAutocomplete = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @param {!Element} proxyElement | 8 * @param {!Element} proxyElement |
| 9 * @param {!Range} wordRange | 9 * @param {!Range} wordRange |
| 10 * @param {boolean} force | 10 * @param {boolean} force |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 var lastIndex = expressionString.length - 1; | 68 var lastIndex = expressionString.length - 1; |
| 69 | 69 |
| 70 var dotNotation = (expressionString[lastIndex] === '.'); | 70 var dotNotation = (expressionString[lastIndex] === '.'); |
| 71 var bracketNotation = (expressionString[lastIndex] === '['); | 71 var bracketNotation = (expressionString[lastIndex] === '['); |
| 72 | 72 |
| 73 if (dotNotation || bracketNotation) | 73 if (dotNotation || bracketNotation) |
| 74 expressionString = expressionString.substr(0, lastIndex); | 74 expressionString = expressionString.substr(0, lastIndex); |
| 75 | 75 |
| 76 // User is entering float value, do not suggest anything. | 76 // User is entering float value, do not suggest anything. |
| 77 if (expressionString && !isNaN(expressionString)) | 77 if ((expressionString && !isNaN(expressionString)) || (!expressionString && qu
ery && !isNaN(query))) |
| 78 return Promise.resolve([]); | 78 return Promise.resolve([]); |
| 79 | 79 |
| 80 if (!query && !expressionString && !force) | 80 if (!query && !expressionString && !force) |
| 81 return Promise.resolve([]); | 81 return Promise.resolve([]); |
| 82 | 82 |
| 83 var fufill; | 83 var fufill; |
| 84 var promise = new Promise(x => fufill = x); | 84 var promise = new Promise(x => fufill = x); |
| 85 if (!expressionString && executionContext.debuggerModel.selectedCallFrame()) | 85 if (!expressionString && executionContext.debuggerModel.selectedCallFrame()) |
| 86 executionContext.debuggerModel.selectedCallFrame().variableNames(receivedPro
pertyNames); | 86 executionContext.debuggerModel.selectedCallFrame().variableNames(receivedPro
pertyNames); |
| 87 else | 87 else |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 caseSensitivePrefix.push(prop); | 283 caseSensitivePrefix.push(prop); |
| 284 else if (property.toLowerCase().startsWith(query.toLowerCase())) | 284 else if (property.toLowerCase().startsWith(query.toLowerCase())) |
| 285 caseInsensitivePrefix.push(prop); | 285 caseInsensitivePrefix.push(prop); |
| 286 else if (property.indexOf(query) !== -1) | 286 else if (property.indexOf(query) !== -1) |
| 287 caseSensitiveAnywhere.push(prop); | 287 caseSensitiveAnywhere.push(prop); |
| 288 else | 288 else |
| 289 caseInsensitiveAnywhere.push(prop); | 289 caseInsensitiveAnywhere.push(prop); |
| 290 } | 290 } |
| 291 return caseSensitivePrefix.concat(caseInsensitivePrefix).concat(caseSensitiveA
nywhere).concat(caseInsensitiveAnywhere); | 291 return caseSensitivePrefix.concat(caseInsensitivePrefix).concat(caseSensitiveA
nywhere).concat(caseInsensitiveAnywhere); |
| 292 }; | 292 }; |
| OLD | NEW |