javascript - Haxe -> JS switch statement branches wrong (Haxe -> Flash of same code works fine), why? -
i've been unable reproduce in complete isolation, here's actual screenshot of haxe code in project:
i if line 567 outputs "true" last value, next trace should have "right", not "wrong". when transpile flash (using haxe 3.2.1), that's how is. however, transpiling html5, in console of firefox or chrome:
state_play.hx:567: fairy_destination,true state_play.hx:572: wrong,fairy_destination,true
my question: how can be?
the js code produced seems sensible enough:
haxe_log.trace(this._ui.get_currmode(),{ filename : "state_play.hx", linenumber : 567, classname : "state_play", methodname : "clickmap", customparams : [this._ui.get_currmode() == "fairy_destination"]}); var _g2 = this._ui.get_currmode(); switch(_g2) { case "fairy_destination": haxe_log.trace("right",{ filename : "state_play.hx", linenumber : 570, classname : "state_play", methodname : "clickmap", customparams : [this._ui.get_currmode(),this._ui.get_currmode() == "fairy_destination"]}); break; default: haxe_log.trace("wrong",{ filename : "state_play.hx", linenumber : 572, classname : "state_play", methodname : "clickmap", customparams : [this._ui.get_currmode(),this._ui.get_currmode() == "fairy_destination"]}); }
i think need create test fails using http://try.haxe.org/ easier help.
Comments
Post a Comment