Skip to content

Commit

Permalink
1547 use strict: octal literals prohibited
Browse files Browse the repository at this point in the history
  • Loading branch information
geraldalewis committed Jan 9, 2012
1 parent 806df9b commit 6a44f2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lexer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ exports.Lexer = class Lexer
return 0 unless match = NUMBER.exec @chunk
number = match[0]
lexedLength = number.length
if octalLiteral = /^0[0-7]+$/.test number
@error 'octal literals are not allowed'
if binaryLiteral = /0b([01]+)/.exec number
number = (parseInt binaryLiteral[1], 2).toString()
@token 'NUMBER', number
Expand Down

0 comments on commit 6a44f2c

Please sign in to comment.