Closed clarkjones closed 8 years ago
So for the line 266 in DomTools e.node.setAttribute(key, Std.string(val));
It looks like calling Std.string(val) inside the method call is causing the problem.
Either assigning this to a var first fixes the issue. Using Reflect.callMethod works as well without needing to set a var first.
I'd still like to reproduce this issue outside of haxe-dom before I open a ticket in the Haxe repo. @Blank101 thoughts?
This does seem like an issue with the Haxe core if that's the case. It could come up in other obscure cases as well, so I'd recommend opening an issue on Haxe core.
Ok will do. Just put it out there the following also seems to work fine if anyone else is seeing this and needs a fix now.
if( Std.is(val,Bool) ){
val ? e.node.setAttribute(key, key) : e.node.removeAttribute(key);
} else {
e.node.setAttribute(key,val);
}
Seems like a 3.3 bug but I haven't actually been able to reproduce this issue outside of haxe-dom yet so I figured I bring it up here first.
The issue I'm seeing (using neko) is that when calling setAttr in DomTools I get:
calling
virtualElement.node.setAttribtute
doesn't throw this exception, it seems like the scope ofthis
being used in setAttribute changes when called using DomTools. Like I said I can't seem to reproduce this outside of haxe-dom but I also can't see how this isn't a 3.3 issue.I've only been using Neko so far so I'm not sure if this is happening on other targets either.