JS Proxying HTML5 canvas context
问题 I'm hoping to proxy the canvas API so I can test that abstracted methods do actually draw to the canvas, however I'm hitting issues where after proxing I get an error: 'strokeStyle' setter called on an object that does not implement interface CanvasRenderingContext2D This code is simplified but throws the same error: /** !NB: This snippet will probably only run in Firefox */ var canvas = document.createElement("canvas"); canvas.width = 100; canvas.height = 100; canvas.style.backgroundColor =