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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/common/TextDictionary.js

Issue 2385273004: DevTools: fix text editor autocompletion (Closed)
Patch Set: Created 4 years, 2 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/autocomplete-general-expected.txt ('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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }, 51 },
52 52
53 /** 53 /**
54 * @param {string} word 54 * @param {string} word
55 */ 55 */
56 removeWord: function(word) 56 removeWord: function(word)
57 { 57 {
58 var count = this._words.get(word) || 0; 58 var count = this._words.get(word) || 0;
59 if (!count) 59 if (!count)
60 return; 60 return;
61 this._index.remove(word);
62 if (count === 1) { 61 if (count === 1) {
63 this._words.delete(word); 62 this._words.delete(word);
63 this._index.remove(word);
64 return; 64 return;
65 } 65 }
66 --count; 66 --count;
67 this._words.set(word, count); 67 this._words.set(word, count);
68 }, 68 },
69 69
70 /** 70 /**
71 * @param {string} prefix 71 * @param {string} prefix
72 * @return {!Array.<string>} 72 * @return {!Array.<string>}
73 */ 73 */
(...skipping 19 matching lines...) Expand all
93 { 93 {
94 return this._words.get(word) || 0; 94 return this._words.get(word) || 0;
95 }, 95 },
96 96
97 reset: function() 97 reset: function()
98 { 98 {
99 this._words.clear(); 99 this._words.clear();
100 this._index.clear(); 100 this._index.clear();
101 } 101 }
102 } 102 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sources/autocomplete-general-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698