code: function scanNumericLiteral() {
          var number, start, ch;
  
          ch = source[index];
          assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
              'Numeric literal must start with a decimal digit or a decimal point');
  
          start = index;
          number = '';
          if (ch !== '.') {
              number = source[index++];
              ch = source[index];
  
              // Hex number starts with '0x'.
              // Octal number starts with '0'.
              if (number === '0') {
                  // decimal number starts with '0' such as '09' is illegal.
                  if (ch && isDecimalDigit(ch.charCodeAt(0))) {
                      throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                  }
              }
  
              while (isDecimalDigit(source.charCodeAt(index))) {
                  number += source[index++];
              }
              ch = source[index];
          }
  
          if (ch === '.') {
              number += source[index++];
              while (isDecimalDigit(source.charCodeAt(index))) {
                  number += source[index++];
              }
              ch = source[index];
          }
  
          if (ch === 'e' || ch === 'E') {
              number += source[index++];
  
              ch = source[index];
              if (ch === '+' || ch === '-') {
                  number += source[index++];
              }
              if (isDecimalDigit(source.charCodeAt(index))) {
                  while (isDecimalDigit(source.charCodeAt(index))) {
                      number += source[index++];
                  }
              } else {
                  throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
              }
          }
  
          if (isIdentifierStart(source.charCodeAt(index))) {
              throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
          }
  
          return {
              type: Token.NumericLiteral,
              value: parseFloat(number),
              range: [start, index]
          };
      }
docs: 7.8.3 Numeric Literals