Browse Source

[parser] don't parse `function () { } (e)` as a call

closes #5854
Simon Krajewski 7 năm trước cách đây
mục cha
commit
2183ca52ce
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 1 0
      extra/CHANGES.txt
  2. 1 1
      src/syntax/grammar.mly

+ 1 - 0
extra/CHANGES.txt

@@ -9,6 +9,7 @@ XXXX-XX-XX:
 
 	Bugfixes:
 
+	all : [breaking] `function () { }(e)` is no longer parsed as a call (#5854)
 	php : Escape `$` in field names of anonymous objects (#7230)
 	php : Generate `switch` as `if...else if...else...` to avoid loose comparison (#7257)
 

+ 1 - 1
src/syntax/grammar.mly

@@ -1035,7 +1035,7 @@ and parse_function p1 inl = parser
 			EFunction ((match name with None -> None | Some (name,pn) -> Some ((if inl then "inline_" ^ name else name),pn)),f), punion p1 (pos e)
 		in
 		(try
-			expr_next (make (secure_expr s)) s
+			make (secure_expr s)
 		with
 			Display e -> display (make e))