windowjs / windowjs

Window.js is an open-source Javascript runtime for desktop graphics programming.

Home Page:https://windowjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`new CanvasGradient()` causes a hard crash

hamish-milne opened this issue · comments

Repro: new CanvasGradient()

Expected output:

Uncaught TypeError: Illegal constructor
    at <anonymous>:1:1

Actual output: crash, Assertion failed on ..\src\js_api_canvas.cc:1961: false

Confirmed, consistent crash.

CanvasGradient is a funny API. The objects must be created via canvas.createLinearGradient and canvas.createRadialGradient, but the constructor also exists, yet it throws TypeError if used. Window.js should throw too, instead of crashing.