Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: test/codegen/expect/functions.js

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var functions = dart.defineLibrary(functions, {}); 1 var functions = dart.defineLibrary(functions, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 (function(exports, core) { 3 (function(exports, core) {
4 'use strict'; 4 'use strict';
5 function bootstrap() { 5 function bootstrap() {
6 return dart.setType([new Foo()], core.List$(Foo)); 6 return dart.list([new Foo()], Foo);
7 } 7 }
8 dart.fn(bootstrap, () => dart.functionType(core.List$(Foo), [])); 8 dart.fn(bootstrap, () => dart.functionType(core.List$(Foo), []));
9 let A2B$ = dart.generic(function(A, B) { 9 let A2B$ = dart.generic(function(A, B) {
10 let A2B = dart.typedef('A2B', () => dart.functionType(B, [A])); 10 let A2B = dart.typedef('A2B', () => dart.functionType(B, [A]));
11 return A2B; 11 return A2B;
12 }); 12 });
13 let A2B = A2B$(); 13 let A2B = A2B$();
14 function id(f) { 14 function id(f) {
15 return f; 15 return f;
16 } 16 }
17 dart.fn(id, () => dart.functionType(A2B$(Foo, Foo), [A2B$(Foo, Foo)])); 17 dart.fn(id, () => dart.functionType(A2B$(Foo, Foo), [A2B$(Foo, Foo)]));
18 class Foo extends core.Object {} 18 class Foo extends core.Object {}
19 function main() { 19 function main() {
20 core.print(bootstrap()[core.$get](0)); 20 core.print(bootstrap()[dartx.get](0));
21 } 21 }
22 dart.fn(main, dart.void, []); 22 dart.fn(main, dart.void, []);
23 // Exports: 23 // Exports:
24 exports.bootstrap = bootstrap; 24 exports.bootstrap = bootstrap;
25 exports.A2B$ = A2B$; 25 exports.A2B$ = A2B$;
26 exports.A2B = A2B; 26 exports.A2B = A2B;
27 exports.id = id; 27 exports.id = id;
28 exports.Foo = Foo; 28 exports.Foo = Foo;
29 exports.main = main; 29 exports.main = main;
30 })(functions, core); 30 })(functions, core);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698