I use a framework that converts variables to Proxies. The proxy contains an ImageBitmap that I want to draw, but drawImage throws an error like "you can't use the Proxy here". How do I fix it?
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
img = new Image();
var handler = { // idk which handler used
get: function(target, name){
return name in target?
target[name] :
37;
}
};
var image = new Proxy(img, handler); // in the project it already set
ctx.drawImage(image /* error */, image.height, image.widht);
<canvas id="canvas">