diff --git a/lib/lexer.js b/lib/lexer.js index cb45c2cf..92b3ebdc 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -595,7 +595,7 @@ })(); JS_KEYWORDS = ['if', 'else', 'true', 'false', 'new', 'return', 'try', 'catch', 'finally', 'throw', 'break', 'continue', 'for', 'in', 'while', 'delete', 'instanceof', 'typeof', 'switch', 'super', 'extends', 'class', 'this', 'null', 'debugger']; COFFEE_ALIASES = ['and', 'or', 'is', 'isnt', 'not']; - COFFEE_KEYWORDS = COFFEE_ALIASES.concat(['then', 'unless', 'until', 'loop', 'yes', 'no', 'on', 'off', 'of', 'by', 'where', 'when']); + COFFEE_KEYWORDS = COFFEE_ALIASES.concat(['then', 'unless', 'until', 'loop', 'yes', 'no', 'on', 'off', 'of', 'by', 'when']); RESERVED = ['case', 'default', 'do', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice']; JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED); IDENTIFIER = /^[a-zA-Z_$][\w$]*/; diff --git a/src/lexer.coffee b/src/lexer.coffee index 20952752..9da8f796 100644 --- a/src/lexer.coffee +++ b/src/lexer.coffee @@ -515,7 +515,7 @@ COFFEE_ALIASES = ['and', 'or', 'is', 'isnt', 'not'] COFFEE_KEYWORDS = COFFEE_ALIASES.concat [ 'then', 'unless', 'until', 'loop' 'yes', 'no', 'on', 'off' - 'of', 'by', 'where', 'when' + 'of', 'by', 'when' ] # The list of keywords that are reserved by JavaScript, but not used, or are diff --git a/test/test_pattern_matching.coffee b/test/test_pattern_matching.coffee index e9243386..69389152 100644 --- a/test/test_pattern_matching.coffee +++ b/test/test_pattern_matching.coffee @@ -141,7 +141,7 @@ deepEqual join2, join3 # Pattern matching doesn't clash with implicit block objects. obj = a: 101 -func -> true +func = -> true if func func {a} = obj