Issue #680. @::prop versus this::prop, fixed lexing regex.
This commit is contained in:
parent
ea3aa6803a
commit
61a39e04fc
|
@ -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'];
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue