OLD | NEW |
1 define(['dart_sdk'], function(dart_sdk) { | 1 define(['dart_sdk'], function(dart_sdk) { |
2 'use strict'; | 2 'use strict'; |
3 const core = dart_sdk.core; | 3 const core = dart_sdk.core; |
4 const dart = dart_sdk.dart; | 4 const dart = dart_sdk.dart; |
5 const dartx = dart_sdk.dartx; | 5 const dartx = dart_sdk.dartx; |
6 const varargs = Object.create(null); | 6 const varargs = Object.create(null); |
7 const src__varargs = Object.create(null); | 7 const src__varargs = Object.create(null); |
8 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.fnType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); | 8 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.fnType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); |
9 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.fnType(dart
.dynamic, [dart.dynamic])))(); | 9 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.fnType(dart
.dynamic, [dart.dynamic])))(); |
10 varargs.varargsTest = function(x, ...others) { | 10 varargs.varargsTest = function(x, ...others) { |
11 let args = [1, others]; | 11 let args = [1, others]; |
12 dart.dcall(x, ...args); | 12 dart.dcall(x, ...args); |
13 }; | 13 }; |
14 dart.fn(varargs.varargsTest, dynamicAnddynamicTodynamic()); | 14 dart.fn(varargs.varargsTest, dynamicAnddynamicTodynamic()); |
15 varargs.varargsTest2 = function(x, ...others) { | 15 varargs.varargsTest2 = function(x, ...others) { |
16 let args = [1, others]; | 16 let args = [1, others]; |
17 dart.dcall(x, ...args); | 17 dart.dcall(x, ...args); |
18 }; | 18 }; |
19 dart.fn(varargs.varargsTest2, dynamicAnddynamicTodynamic()); | 19 dart.fn(varargs.varargsTest2, dynamicAnddynamicTodynamic()); |
20 src__varargs._Rest = class _Rest extends core.Object { | 20 src__varargs._Rest = class _Rest extends core.Object {}; |
21 new() { | 21 (src__varargs._Rest.new = function() { |
22 } | 22 }).prototype = src__varargs._Rest.prototype; |
23 }; | |
24 dart.defineLazy(src__varargs, { | 23 dart.defineLazy(src__varargs, { |
25 get rest() { | 24 get rest() { |
26 return dart.const(new src__varargs._Rest()); | 25 return dart.const(new src__varargs._Rest.new()); |
27 } | 26 } |
28 }); | 27 }); |
29 src__varargs.spread = function(args) { | 28 src__varargs.spread = function(args) { |
30 dart.throw(new core.StateError('The spread function cannot be called, ' + 'i
t should be compiled away.')); | 29 dart.throw(new core.StateError.new('The spread function cannot be called, '
+ 'it should be compiled away.')); |
31 }; | 30 }; |
32 dart.fn(src__varargs.spread, dynamicTodynamic()); | 31 dart.fn(src__varargs.spread, dynamicTodynamic()); |
33 dart.trackLibraries("varargs", { | 32 dart.trackLibraries("varargs", { |
34 "varargs.dart": varargs, | 33 "varargs.dart": varargs, |
35 "package:js/src/varargs.dart": src__varargs | 34 "package:js/src/varargs.dart": src__varargs |
36 }, null); | 35 }, null); |
37 // Exports: | 36 // Exports: |
38 return { | 37 return { |
39 varargs: varargs, | 38 varargs: varargs, |
40 src__varargs: src__varargs | 39 src__varargs: src__varargs |
41 }; | 40 }; |
42 }); | 41 }); |
OLD | NEW |