Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use of __js__ & Std.is #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions std/haxe/unit/TestRunner.hx
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ class TestRunner {
#elseif js
var msg = js.Boot.__string_rec(v,"");
var d;
if( __js__("typeof")(document) != "undefined"
if( js.Syntax.code("typeof")(document) != "undefined"
&& (d = document.getElementById("haxe:trace")) != null ) {
msg = StringTools.htmlEscape(msg).split("\n").join("<br/>");
d.innerHTML += msg+"<br/>";
}
else if ( __js__("typeof process") != "undefined"
&& __js__("process").stdout != null
&& __js__("process").stdout.write != null)
__js__("process").stdout.write(msg); // node
else if ( __js__("typeof console") != "undefined"
&& __js__("console").log != null )
__js__("console").log(msg); // document-less js (which may include a line break)
else if ( js.Syntax.code("typeof process") != "undefined"
&& js.Syntax.code("process").stdout != null
&& js.Syntax.code("process").stdout.write != null)
js.Syntax.code("process").stdout.write(msg); // node
else if ( js.Syntax.code("typeof console") != "undefined"
&& js.Syntax.code("console").log != null )
js.Syntax.code("console").log(msg); // document-less js (which may include a line break)

#elseif cs
cs.system.Console.Write(v);
Expand Down
2 changes: 1 addition & 1 deletion std/haxe/web/Dispatch.hx
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ class Dispatch {
var c = Type.getClass(obj);
var dc = haxe.rtti.Meta.getType(c);
var m : Dynamic = dc.dispatchConfig[0];
if( Std.is(m,String) ) {
if( Std.isOfType(m,String) ) {
m = haxe.Unserializer.run(m);
dc.dispatchConfig[0] = m;
}
Expand Down
2 changes: 1 addition & 1 deletion std/js/JQuery.hx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ extern class JQuery implements ArrayAccess<Element> {
#error "Haxe no longer bundle third-party JS libraries. Please remove `-D embed-js`. You may download the JS files and use `haxe.macro.Compiler.includeFile`."
#end
var q : Dynamic = (untyped js.Browser.window).jQuery;
untyped __js__("var js = js || {}");
untyped js.Syntax.code("var js = js || {}");
js.JQuery = q;
__feature__('js.JQuery.iterator',
q.fn.iterator = function() return { pos : 0, j : __this__, hasNext : function() return __this__.pos < __this__.j.length, next : function() return $(__this__.j[__this__.pos++]) }
Expand Down
2 changes: 1 addition & 1 deletion std/neko/net/ServerLoop.hx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class ServerLoop<ClientData> {
readData(cl);
processData(cl);
} catch( e : Dynamic ) {
if( !Std.is(e,haxe.io.Eof) )
if( !Std.isOfType(e,haxe.io.Eof) )
onError(e);
closeConnection(cl.sock);
}
Expand Down
4 changes: 2 additions & 2 deletions std/neko/net/ThreadRemotingServer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ThreadRemotingServer extends ThreadServer<haxe.remoting.SocketConnection,S
var cnx = haxe.remoting.SocketConnection.create(s,ctx);
var me = this;
cnx.setErrorHandler(function(e) {
if( !Std.is(e,haxe.io.Eof) && !Std.is(e,haxe.io.Error) )
if( !Std.isOfType(e,haxe.io.Eof) && !Std.isOfType(e,haxe.io.Error) )
me.logError(e);
me.stopClient(s);
});
Expand Down Expand Up @@ -105,7 +105,7 @@ class ThreadRemotingServer extends ThreadServer<haxe.remoting.SocketConnection,S
} else
cnx.processMessage(msg);
} catch( e : Dynamic ) {
if( !Std.is(e,haxe.io.Eof) && !Std.is(e,haxe.io.Error) )
if( !Std.isOfType(e,haxe.io.Eof) && !Std.isOfType(e,haxe.io.Error) )
logError(e);
stopClient(cnx.getProtocol().socket);
}
Expand Down
2 changes: 1 addition & 1 deletion std/neko/net/ThreadServer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ThreadServer<Client,Message> {
readClientData(infos);
} catch( e : Dynamic ) {
t.socks.remove(s);
if( !Std.is(e,haxe.io.Eof) && !Std.is(e,haxe.io.Error) )
if( !Std.isOfType(e,haxe.io.Eof) && !Std.isOfType(e,haxe.io.Error) )
logError(e);
work(doClientDisconnected.bind(s,infos.client));
}
Expand Down