فهرست منبع

{} is now an empty object

Nicolas Cannasse 17 سال پیش
والد
کامیت
aac22c9e99
2فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      parser.ml

+ 1 - 0
doc/CHANGES.txt

@@ -6,6 +6,7 @@
 	bugfix to prevent recursive anonymous
 	fixed some incorrectly reported "recursive inline" errors
 	fixes in genas3 + genswf9 for Dynamic/* in methods
+	{} is now an empty object and not an empty block
 	TODO haxe/f9 : inline code can give bad file in debug infos
 	TODO haxe/f9 var x = if( true ) Math.POSITIVE_INFINITY : 0.; VerifyError
 

+ 1 - 1
parser.ml

@@ -422,7 +422,7 @@ and parse_class_herit = parser
 and block1 = parser
 	| [< '(Const (Ident name),p); s >] -> block2 name true p s
 	| [< '(Const (Type name),p); s >] -> block2 name false p s
-	| [< b = block [] >] -> EBlock b
+	| [< b = block [] >] -> (match b with [] -> EObjectDecl [] | _ -> EBlock b)
 
 and block2 name ident p = parser
 	| [< '(DblDot,_); e = expr; l = parse_obj_decl >] -> EObjectDecl ((name,e) :: l)