I'm trying to call mozRequestAnimationFrame in firefox, but I keep getting an error. Here is my code:
var obj={
animFrame:mozRequestAnimationFrame
}
var animF=mozRequestAnimationFrame;
function a(){
console.log('a called');
}
animF(a);
obj.animFrame(a);
The error occurs with the obj.animFrame(a);
I get an error message of:
Illegal operation on WrappedNative prototype object
I found this thread on SO: requestAnimationFrame with this keyword and then figured that maybe requestanimationframe didn't have the right "this" context, so I tried
obj.animFrame(a).bind(window);
but still got the same error message. So why is the error occurring?