fixing issue #427 -- incorrect stringification of reserved word

This commit is contained in:
Jeremy Ashkenas 2010-07-04 20:55:21 -04:00
parent c57ebffe6f
commit e81810d845
3 changed files with 9 additions and 2 deletions

View File

@ -607,7 +607,7 @@
STRING_NEWLINES = /\n[ \t]*/g;
NO_NEWLINE = /^([+\*&|\/\-%=<>:!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/;
HEREDOC_INDENT = /(\n+([ \t]*)|^([ \t]+))/g;
ASSIGNED = /^([a-zA-Z\$_]\w*[ \t]*?[:=])/;
ASSIGNED = /^([a-zA-Z\$_]\w*[ \t]*?[:=][^=])/;
NEXT_CHARACTER = /^\s*(\S)/;
NOT_REGEX = ['NUMBER', 'REGEX', '++', '--', 'FALSE', 'NULL', 'TRUE', ']'];
CALLABLE = ['IDENTIFIER', 'SUPER', ')', ']', '}', 'STRING', '@', 'THIS', '?', '::'];

View File

@ -530,7 +530,7 @@ MULTILINER : /\n/g
STRING_NEWLINES : /\n[ \t]*/g
NO_NEWLINE : /^([+\*&|\/\-%=<>:!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/
HEREDOC_INDENT : /(\n+([ \t]*)|^([ \t]+))/g
ASSIGNED : /^([a-zA-Z\$_]\w*[ \t]*?[:=])/
ASSIGNED : /^([a-zA-Z\$_]\w*[ \t]*?[:=][^=])/
NEXT_CHARACTER : /^\s*(\S)/
# Tokens which a regular expression will never immediately follow, but which

View File

@ -114,3 +114,10 @@ obj: {class: 'höt'}
obj.function: 'dog'
ok obj.class + obj.function is 'hötdog'
# But keyword assignment should be smart enough not to stringify variables.
func: ->
this == 'this'
ok func() is false