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 script = Object.create(null); | 6 const script = Object.create(null); |
7 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String))
)(); | 7 let ListOfString = () => (ListOfString = dart.constFn(core.List$(core.String))
)(); |
8 let ListOfStringTovoid = () => (ListOfStringTovoid = dart.constFn(dart.definit
eFunctionType(dart.void, [ListOfString()])))(); | 8 let ListOfStringTovoid = () => (ListOfStringTovoid = dart.constFn(dart.fnType(
dart.void, [ListOfString()])))(); |
9 script.main = function(args) { | 9 script.main = function(args) { |
10 let name = args[dartx.join](' '); | 10 let name = args[dartx.join](' '); |
11 if (name == '') name = 'world'; | 11 if (name == '') name = 'world'; |
12 core.print(dart.str`hello ${name}`); | 12 core.print(dart.str`hello ${name}`); |
13 }; | 13 }; |
14 dart.fn(script.main, ListOfStringTovoid()); | 14 dart.fn(script.main, ListOfStringTovoid()); |
15 dart.trackLibraries("script", { | 15 dart.trackLibraries("script", { |
16 "script.dart": script | 16 "script.dart": script |
17 }, null); | 17 }, null); |
18 // Exports: | 18 // Exports: |
19 return { | 19 return { |
20 script: script | 20 script: script |
21 }; | 21 }; |
22 }); | 22 }); |
OLD | NEW |