Skip to content

CanvasRenderingContext2D setFillColor tries to unwrap a number #722

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


 void render(html.CanvasRenderingContext2D context) {
       num r = 255;
       num g = 0;
       num b = 0;
       context.setFillColor(r, g, b);
       context.fillRect(100, 100, 64, 64);
   }

The call CanvasRenderingContext2DWrappingImplementation.setFillColor correctly determines that r is a number and that g and b are non-null. It then calls

this._ptr.setFillColor$4(LevelDom.unwrap(c_OR_color_OR_grayLevel_OR_r), alpha_OR_g_OR_m, b_OR_y, a_OR_k);

which tries to unwrap r as a number, which fails with the exception:

Uncaught TypeError: Object 255 has no method 'get$_ptr'
    LevelDom.unwrap
    CanvasRenderingContext2DWrappingImplementation.setFillColor

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions