fixed pipeline module loading; better parse errors for function literals in objects
This commit is contained in:
9
parse.cm
9
parse.cm
@@ -437,7 +437,14 @@ var parse = function(tokens, src, filename, tokenizer) {
|
||||
}
|
||||
push(list, pair)
|
||||
if (tok.kind == ",") advance()
|
||||
else break
|
||||
else if (tok.kind == "{") {
|
||||
if (right && right.kind == "(") {
|
||||
parse_error(tok, "unexpected '{' after property value; use method shorthand `name(args) { ... }` or `name: function(args) { ... }`")
|
||||
} else {
|
||||
parse_error(tok, "expected ',' or '}' in object literal")
|
||||
}
|
||||
break
|
||||
} else break
|
||||
}
|
||||
ast_node_end(node)
|
||||
if (tok.kind == "}") advance()
|
||||
|
||||
Reference in New Issue
Block a user