浏览代码

Removed needless repetition of string concatenation for $hx_exports

Luca Deltodesco 11 年之前
父节点
当前提交
b316f97162
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      genjs.ml

+ 3 - 2
genjs.ml

@@ -1232,10 +1232,11 @@ let generate com =
 		print ctx ") { \"use strict\"";
 		newline ctx;
 		let rec print_obj f root = (
-			print ctx "%s.%s = %s.%s || {}" root f.os_name root f.os_name;
+			let path = root ^ "." ^ f.os_name in
+			print ctx "%s = %s || {}" path path;
 			ctx.separator <- true;
 			newline ctx;
-			concat ctx ";" (fun g -> print_obj g (root ^ "." ^ f.os_name)) f.os_fields
+			concat ctx ";" (fun g -> print_obj g path) f.os_fields
 		)
 		in
 		List.iter (fun f -> print_obj f "$hx_exports") exposedObject.os_fields;