From 329b2d1cb23b78938716b9cf2ff7da272ab2667e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20P=C3=A1nek?= Date: Mon, 26 Sep 2016 18:03:38 +0200 Subject: [PATCH] Pass through octal and binary literals as-is See https://github.com/coffeescript6/discuss/issues/45 --- src/lexer.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lexer.coffee b/src/lexer.coffee index 3e55780f2e..7e6526eef9 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -211,9 +211,8 @@ exports.Lexer = class Lexer when 'o' then 8 when 'x' then 16 else null + numberValue = if base? then parseInt(number[2..], base) else parseFloat(number) - if number.charAt(1) in ['b', 'o'] - number = "0x#{numberValue.toString 16}" tag = if numberValue is Infinity then 'INFINITY' else 'NUMBER' @token tag, number, 0, lexedLength