OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @param {!CodeMirror} codeMirror | 7 * @param {!CodeMirror} codeMirror |
8 * @param {string=} additionalWordChars | 8 * @param {string=} additionalWordChars |
9 */ | 9 */ |
10 WebInspector.CodeMirrorDictionary = function(codeMirror, additionalWordChars) | 10 WebInspector.CodeMirrorDictionary = function(codeMirror, additionalWordChars) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 for (var lineNumber in linesToUpdate) | 55 for (var lineNumber in linesToUpdate) |
56 this._addText(linesToUpdate[lineNumber]); | 56 this._addText(linesToUpdate[lineNumber]); |
57 }, | 57 }, |
58 | 58 |
59 /** | 59 /** |
60 * @param {string} word | 60 * @param {string} word |
61 * @return {boolean} | 61 * @return {boolean} |
62 */ | 62 */ |
63 _validWord: function(word) | 63 _validWord: function(word) |
64 { | 64 { |
65 return !!word.length && (word[0] < '0' || word[0] > '9'); | 65 return !!word.length && (word[0] < "0" || word[0] > "9"); |
66 }, | 66 }, |
67 | 67 |
68 /** | 68 /** |
69 * @param {string} text | 69 * @param {string} text |
70 */ | 70 */ |
71 _addText: function(text) | 71 _addText: function(text) |
72 { | 72 { |
73 WebInspector.TextUtils.textToWords(text, this.isWordChar.bind(this), add
Word.bind(this)); | 73 WebInspector.TextUtils.textToWords(text, this.isWordChar.bind(this), add
Word.bind(this)); |
74 | 74 |
75 /** | 75 /** |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 { | 136 { |
137 return this._dictionary.wordCount(word); | 137 return this._dictionary.wordCount(word); |
138 }, | 138 }, |
139 | 139 |
140 dispose: function() | 140 dispose: function() |
141 { | 141 { |
142 this._codeMirror.off("beforeChange", this._beforeChange); | 142 this._codeMirror.off("beforeChange", this._beforeChange); |
143 this._codeMirror.off("changes", this._changes); | 143 this._codeMirror.off("changes", this._changes); |
144 this._dictionary.reset(); | 144 this._dictionary.reset(); |
145 }, | 145 }, |
146 } | 146 } |
OLD | NEW |