瀏覽代碼

{} 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)