[next] null as optional parameter for functions in CanvasRenderingContext2D with CanvasWindingRule #15126
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-not-planned
Closed as we don't intend to take action on the reported issue
library-html
This issue was originally filed by @denniskaselow
What steps will reproduce the problem?
import 'dart:html';
void main() {
var canvas = new CanvasElement();
canvas.context2D.fill(null);
}
What is the expected output? What do you see instead?
Works in Dart but does not work in JS.
When run in JS, following error occurs:
TypeError: Argument 1 of CanvasRenderingContext2D.fill 'null' is not a valid value for enumeration CanvasWindingRule.
What version of the product are you using? On what operating system?
Dart Editor version 1.0.0_r30188 (STABLE)
Dart SDK version 1.0.0.3_r30188
Please provide any additional information below.
I'm not sure if it really is a bug but at least it's a bit of an inconsistency between Dart and JS (error can probably pop up for similar functions). In my case I am delegating a call to fill and just pass the optional parameter without checking for null (easy workaround: I check for null and call the method without a param). Also, no need to bring ?param back ;).
The text was updated successfully, but these errors were encountered: