text: 'use strict';
  
  var UNDEFINED_CODE_POINTS = [
      0xFFFE, 0xFFFF, 0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE, 0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
      0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF,
      0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE, 0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF, 0x10FFFE,
      0x10FFFF
  ];
  
  exports.REPLACEMENT_CHARACTER = '\uFFFD';
  
  exports.CODE_POINTS = {
      EOF: -1,
      NULL: 0x00,
      TABULATION: 0x09,
      CARRIAGE_RETURN: 0x0D,
      LINE_FEED: 0x0A,
      FORM_FEED: 0x0C,
      SPACE: 0x20,
      EXCLAMATION_MARK: 0x21,
      QUOTATION_MARK: 0x22,
      NUMBER_SIGN: 0x23,
      AMPERSAND: 0x26,
      APOSTROPHE: 0x27,
      HYPHEN_MINUS: 0x2D,
      SOLIDUS: 0x2F,
      DIGIT_0: 0x30,
      DIGIT_9: 0x39,
      SEMICOLON: 0x3B,
      LESS_THAN_SIGN: 0x3C,
      EQUALS_SIGN: 0x3D,
      GREATER_THAN_SIGN: 0x3E,
      QUESTION_MARK: 0x3F,
      LATIN_CAPITAL_A: 0x41,
      LATIN_CAPITAL_F: 0x46,
      LATIN_CAPITAL_X: 0x58,
      LATIN_CAPITAL_Z: 0x5A,
      RIGHT_SQUARE_BRACKET: 0x5D,
      GRAVE_ACCENT: 0x60,
      LATIN_SMALL_A: 0x61,
      LATIN_SMALL_F: 0x66,
      LATIN_SMALL_X: 0x78,
      LATIN_SMALL_Z: 0x7A,
      REPLACEMENT_CHARACTER: 0xFFFD
  };
  
  exports.CODE_POINT_SEQUENCES = {
      DASH_DASH_STRING: [0x2D, 0x2D], //--
      DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE
      CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[
      SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script
      PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC
      SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM
  };
  
  
  //Surrogates
  exports.isSurrogate = function (cp) {
      return cp >= 0xD800 && cp <= 0xDFFF;
  };
  
  exports.isSurrogatePair = function (cp) {
      return cp >= 0xDC00 && cp <= 0xDFFF;
  };
  
  exports.getSurrogatePairCodePoint = function (cp1, cp2) {
      return (cp1 - 0xD800) * 0x400 + 0x2400 + cp2;
  };
  
  //NOTE: excluding NULL and ASCII whitespace
  exports.isControlCodePoint = function (cp) {
      return cp !== 0x20 && cp !== 0x0A &&
          cp !== 0x0D && cp !== 0x09 && cp !== 0x0C &&
          cp >= 0x01 && cp <= 0x1F || cp >= 0x7F && cp <= 0x9F;
  };
  
  exports.isUndefinedCodePoint = function (cp) {
      return cp >= 0xFDD0 && cp <= 0xFDEF || UNDEFINED_CODE_POINTS.indexOf(cp) > -1;
  };
  