Files
sdk/pkg/dev_compiler/test/runtime
Vijay Menon 20cf4c9c4b Runtime arity helper function
We'll need to figure out an efficient way to do this in JS output.

An alternative, suggested by Jacob, is only provide something like an applyTruncated function.  E.g., something like:

dynamic applyTruncated(Function f, List args) {
  var arity = getArity(f);
  assert(args.length >= arity.min);
  args = args.sublist(0, arity.max);
  return Function.apply(f, args);
}

Jacob: is this what you have in mind?

If so, we could *only* provide this.  The dart2j impl could use the existing code pattern of is-checks.  The ddc implementation could map to JS apply (with a check for named params?).

Thoughts?

R=jacobr@google.com

Review URL: https://chromereviews.googleplex.com/137047014
2015-01-13 17:55:44 -08:00
..