Why does this throw a "Uncaught TypeError: Illegal invocation"?
function Game () {
this.reqAnimFrame = window.requestAnimationFrame;
this.gameLoop = function () {
this.reqAnimFrame(this.gameLoop); // It's thrown on this line
};
}
var game = new Game();
game.gameLoop();
Aucun commentaire:
Enregistrer un commentaire