Issue #680. @::prop versus this::prop, fixed lexing regex.

This commit is contained in:
Jeremy Ashkenas 2010-09-12 15:48:31 -04:00
parent ea3aa6803a
commit 61a39e04fc
3 changed files with 15 additions and 3 deletions

View File

@ -629,7 +629,7 @@
MULTILINER = /\n/g;
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/;
HEREDOC_INDENT = /(\n+([ \t]*)|^([ \t]+))/g;
ASSIGNED = /^\s*(([a-zA-Z\$_@]\w*|["'][^\r\n]+?["']|\d+)[ \t]*?[:=][^=])/;
ASSIGNED = /^\s*(([a-zA-Z\$_@]\w*|["'][^\r\n]+?["']|\d+)[ \t]*?[:=][^:=])/;
NEXT_CHARACTER = /^\s*(\S)/;
COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
UNARY = ['UMINUS', 'UPLUS', '!', '!!', '~', 'TYPEOF', 'DELETE'];

View File

@ -545,7 +545,7 @@ JS_CLEANER = /(^`|`$)/g
MULTILINER = /\n/g
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/
HEREDOC_INDENT = /(\n+([ \t]*)|^([ \t]+))/g
ASSIGNED = /^\s*(([a-zA-Z\$_@]\w*|["'][^\r\n]+?["']|\d+)[ \t]*?[:=][^=])/
ASSIGNED = /^\s*(([a-zA-Z\$_@]\w*|["'][^\r\n]+?["']|\d+)[ \t]*?[:=][^:=])/
NEXT_CHARACTER = /^\s*(\S)/
# Compound assignment tokens.

View File

@ -25,4 +25,16 @@ obj = {
}
ok obj.num is obj.func()
ok obj.num is obj.result
ok obj.num is obj.result
# Should be able to look at prototypes on keywords.
obj =
withAt: -> @::prop
withThis: -> this::prop
proto:
prop: 100
obj.prototype = obj.proto
ok obj.withAt() is 100
ok obj.withThis() is 100