Explorar el Código

[js] fixed "Invalid_argument" on generating "function $bind" (#8084)

Alexander Kuzmenko hace 6 años
padre
commit
13252e8cb5
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/generators/genjs.ml

+ 3 - 2
src/generators/genjs.ml

@@ -1761,9 +1761,10 @@ let generate com =
 	end;
 	if has_feature ctx "use.$bind" then begin
 		add_feature ctx "$global.$haxeUID";
-		if not has_dollar_underscore then
+		if not has_dollar_underscore then begin
 			print ctx "var $_";
-		newline ctx;
+			newline ctx;
+		end;
 		(if ctx.es_version < 5 then
 			print ctx "function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; }"
 		else