JavaScript: added CanvasRenderingContext2D methods