Commits

Daniel Herzog committed 52861a9 Draft

Moved methods to prototype

Comments (0)

Files changed (1)

src/syntaxhighlight/http-header/tokenizer.js

 
 cls.HTTPHeaderTokenizer = function()
 {
+  this._buffer = "";
+  this._current_pos = 0;
+  this._token_buffer = "";
+  this._state_handler = {};
+};
+
+cls.HTTPHeaderTokenizerPrototype = function()
+{
   var LF = "\n";
   var PUNCTUATOR = ":";
   var WHITESPACE_CHARS = {
     "\u0009": 1, //  Tab <TAB>
-    "\u0020": 1, //  Space <SP>
+    "\u0020": 1  //  Space <SP>
   };
 
-  this._buffer = "";
-  this._current_pos = 0;
-  this._token_buffer = "";
-  this._state_handler = {};
-
   this.tokenize = function(input_buffer, ontoken)
   {
     this._state_handler = this._state_handlers.FIRST_LINE_PART;
     }
     return false;
   };
-}
+};
+
+cls.HTTPHeaderTokenizer.prototype = new cls.HTTPHeaderTokenizerPrototype();
 
 cls.HTTPHeaderTokenizer.types = {
     FIRST_LINE_PART  : 1,