-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
web-js-interopIssues that impact all js interopIssues that impact all js interop
Description
A @varargs
or @rest
annotation would be useful in two use-cases:
-
To implement ES6 JS helpers with rest params in DDC (see Write all of the runtime in Dart. dart-archive/dev_compiler#310):
mixin(base, @js.varargs mixins) {...}
Would be compiled by DDC to:
function mixin(base, ...mixins) {...}
-
To call external (or internal) methods with rest params. The following call:
foo(a, b, js.varargs(others)) // or js.rest(others)
Would be compiled to ES6 code by DDC:
foo(a, b, ...others)
And to something like the following ES5 code by dart2js (some devil in the
this
binding details):foo.apply(null, [a, b].concat(others))
Metadata
Metadata
Assignees
Labels
web-js-interopIssues that impact all js interopIssues that impact all js interop