Hello people, this is my first day using Haxe, and I am liking it so far but I have a question
I am using js.Browser and for debugging I want to attach an object to the global window object.
However the following (understandably) fails with js.html.Window has no field foo:
Browser.window.foo = 33;
Which of course makes sense … Haxe has a strict type system. I’d however still like some escape hatch for this. I’m very new to Haxe so I don’t know if there is one?
Hi, not answering your specific question, but you can use @:expose to make Haxe classes or static fields accessible from Javascript. Maybe it can help your debugging ?
class Test {
static function main() {
var window:haxe.DynamicAccess<Dynamic> = untyped js.Browser.window;
window.set('gina','pino');
trace(window.get('gina'));
}
}```