我想端口一些代码从JS到Haxe。是否可以重写Haxe中的js.html.Window类的函数?
的代码覆盖Window.getComputedStyle到workarround一个Firefox的问题(Bugzilla link):
window.oldGetComputedStyle = window .getComputedStyle;
window.getComputedStyle = function (element, pseudoElt) {
var t = window.oldGetComputedStyle(element, pseudoElt);
if (t === null) {
return {};
} else{
return t;
}
};
我该如何解决这个问题?
当我想,我得到了以下错误:
Cannot rebind this method : please use 'dynamic' before method declaration
问题你问需要澄清。 “我可以使用Haxe覆盖这个功能吗?”是或不是。改变你的问题,要求澄清你的错误将有助于你获得更好的信息。 – Nathan