| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 "regexp": FormatterWorker.JavaScriptTokens.DIV, | 979 "regexp": FormatterWorker.JavaScriptTokens.DIV, |
| 980 "string": FormatterWorker.JavaScriptTokens.STRING | 980 "string": FormatterWorker.JavaScriptTokens.STRING |
| 981 }; | 981 }; |
| 982 | 982 |
| 983 /** | 983 /** |
| 984 * @constructor | 984 * @constructor |
| 985 * @param {string} content | 985 * @param {string} content |
| 986 */ | 986 */ |
| 987 FormatterWorker.JavaScriptTokenizer = function(content) | 987 FormatterWorker.JavaScriptTokenizer = function(content) |
| 988 { | 988 { |
| 989 this._readNextToken = parse.tokenizer(content); | 989 this._readNextToken = tokenizerHolder.tokenizer(content); |
| 990 this._state = this._readNextToken.context(); | 990 this._state = this._readNextToken.context(); |
| 991 } | 991 } |
| 992 | 992 |
| 993 FormatterWorker.JavaScriptTokenizer.prototype = { | 993 FormatterWorker.JavaScriptTokenizer.prototype = { |
| 994 /** | 994 /** |
| 995 * @return {string} | 995 * @return {string} |
| 996 */ | 996 */ |
| 997 content: function() | 997 content: function() |
| 998 { | 998 { |
| 999 return this._state.text; | 999 return this._state.text; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1019 { | 1019 { |
| 1020 var token = FormatterWorker.JavaScriptTokensByType[uglifyToken.type]; | 1020 var token = FormatterWorker.JavaScriptTokensByType[uglifyToken.type]; |
| 1021 if (typeof token === "number") | 1021 if (typeof token === "number") |
| 1022 return token; | 1022 return token; |
| 1023 token = FormatterWorker.JavaScriptTokensByValue[uglifyToken.value]; | 1023 token = FormatterWorker.JavaScriptTokensByValue[uglifyToken.value]; |
| 1024 if (typeof token === "number") | 1024 if (typeof token === "number") |
| 1025 return token; | 1025 return token; |
| 1026 throw "Unknown token type " + uglifyToken.type; | 1026 throw "Unknown token type " + uglifyToken.type; |
| 1027 } | 1027 } |
| 1028 } | 1028 } |
| OLD | NEW |