mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Issue #680. @::prop versus this::prop, fixed lexing regex.
This commit is contained in:
parent
ea3aa6803a
commit
61a39e04fc
3 changed files with 15 additions and 3 deletions
|
|
@ -629,7 +629,7 @@
|
||||||
MULTILINER = /\n/g;
|
MULTILINER = /\n/g;
|
||||||
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/;
|
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/;
|
||||||
HEREDOC_INDENT = /(\n+([ \t]*)|^([ \t]+))/g;
|
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)/;
|
NEXT_CHARACTER = /^\s*(\S)/;
|
||||||
COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
|
COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
|
||||||
UNARY = ['UMINUS', 'UPLUS', '!', '!!', '~', 'TYPEOF', 'DELETE'];
|
UNARY = ['UMINUS', 'UPLUS', '!', '!!', '~', 'TYPEOF', 'DELETE'];
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,7 @@ JS_CLEANER = /(^`|`$)/g
|
||||||
MULTILINER = /\n/g
|
MULTILINER = /\n/g
|
||||||
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/
|
NO_NEWLINE = /^([+\*&|\/\-%=<>!.\\][<>=&|]*|and|or|is|isnt|not|delete|typeof|instanceof)$/
|
||||||
HEREDOC_INDENT = /(\n+([ \t]*)|^([ \t]+))/g
|
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)/
|
NEXT_CHARACTER = /^\s*(\S)/
|
||||||
|
|
||||||
# Compound assignment tokens.
|
# Compound assignment tokens.
|
||||||
|
|
|
||||||
|
|
@ -26,3 +26,15 @@ obj = {
|
||||||
|
|
||||||
ok obj.num is obj.func()
|
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…
Add table
Add a link
Reference in a new issue