Browse Source

small syntax fix in value blocks

Nicolas Cannasse 16 years ago
parent
commit
4fbaa2252b
2 changed files with 3 additions and 2 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 2 2
      genjs.ml

+ 1 - 0
doc/CHANGES.txt

@@ -12,6 +12,7 @@ TODO :
 	flash9 : added error message in flash.Vector if used without flash 10
 	flash9 : fixed some "never" property access issues
 	all : added "never" property access support for all platforms
+	js : small syntax fix with value-blocks
 
 2009-03-22: 2.03
 	optimized Type.enumEq : use index instead of tag comparison for neko/flash9/php

+ 2 - 2
genjs.ml

@@ -481,7 +481,7 @@ and gen_value ctx e =
 		let old = ctx.in_value, ctx.in_loop in
 		ctx.in_value <- true;
 		ctx.in_loop <- false;
-		spr ctx "function($this) ";
+		spr ctx "(function($this) ";
 		let b = if block then begin
 			spr ctx "{";
 			let b = open_block ctx in
@@ -502,7 +502,7 @@ and gen_value ctx e =
 			end;
 			ctx.in_value <- fst old;
 			ctx.in_loop <- snd old;
-			print ctx "(%s)" (this ctx)
+			print ctx "(%s))" (this ctx)
 		)
 	in
 	match e.eexpr with