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

Side by Side Diff: Source/devtools/front_end/RuntimeModel.js

Issue 97093004: [DevTools] Tuned console completion filter to allow non-ascii properties auto-completion. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 const keywords = ["break", "case", "catch", "continue", "default", " delete", "do", "else", "finally", "for", "function", "if", "in", 295 const keywords = ["break", "case", "catch", "continue", "default", " delete", "do", "else", "finally", "for", "function", "if", "in",
296 "instanceof", "new", "return", "switch", "this", " throw", "try", "typeof", "var", "void", "while", "with"]; 296 "instanceof", "new", "return", "switch", "this", " throw", "try", "typeof", "var", "void", "while", "with"];
297 properties = properties.concat(keywords); 297 properties = properties.concat(keywords);
298 } 298 }
299 299
300 properties.sort(); 300 properties.sort();
301 301
302 for (var i = 0; i < properties.length; ++i) { 302 for (var i = 0; i < properties.length; ++i) {
303 var property = properties[i]; 303 var property = properties[i];
304 304
305 if (dotNotation && !/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(property)) 305 // Assume that all non-ASCII characters are letters and thus can be used as part of identifier.
306 if (dotNotation && !/^[a-zA-Z_$\u008F-\uFFFF][a-zA-Z0-9_$\u008F-\uFF FF]*$/.test(property))
306 continue; 307 continue;
307 308
308 if (bracketNotation) { 309 if (bracketNotation) {
309 if (!/^[0-9]+$/.test(property)) 310 if (!/^[0-9]+$/.test(property))
310 property = quoteUsed + property.escapeCharacters(quoteUsed + "\\") + quoteUsed; 311 property = quoteUsed + property.escapeCharacters(quoteUsed + "\\") + quoteUsed;
311 property += "]"; 312 property += "]";
312 } 313 }
313 314
314 if (property.length < prefix.length) 315 if (property.length < prefix.length)
315 continue; 316 continue;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 if (subtitle) { 448 if (subtitle) {
448 if (!name) 449 if (!name)
449 return subtitle; 450 return subtitle;
450 return name + "( " + subtitle + " )"; 451 return name + "( " + subtitle + " )";
451 } 452 }
452 return "<iframe>"; 453 return "<iframe>";
453 }, 454 },
454 455
455 __proto__: WebInspector.Object.prototype 456 __proto__: WebInspector.Object.prototype
456 } 457 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698