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

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

Issue 1926283002: implement generic method runtime behavior, fixes #301 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « test/codegen/expect/closure.js ('k') | test/codegen/expect/unittest.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('functions', null, /* Imports */[ 1 dart_library.library('functions', null, /* Imports */[
2 'dart_sdk' 2 'dart_sdk'
3 ], function(exports, dart_sdk) { 3 ], function(exports, dart_sdk) {
4 'use strict'; 4 'use strict';
5 const core = dart_sdk.core; 5 const core = dart_sdk.core;
6 const dart = dart_sdk.dart; 6 const dart = dart_sdk.dart;
7 const dartx = dart_sdk.dartx; 7 const dartx = dart_sdk.dartx;
8 const functions = Object.create(null); 8 const functions = Object.create(null);
9 functions.bootstrap = function() { 9 functions.bootstrap = function() {
10 return dart.list([new functions.Foo()], functions.Foo); 10 return dart.list([new functions.Foo()], functions.Foo);
11 }; 11 };
12 dart.fn(functions.bootstrap, () => dart.definiteFunctionType(core.List$(functi ons.Foo), [])); 12 dart.lazyFn(functions.bootstrap, () => [core.List$(functions.Foo), []]);
13 functions.A2B$ = dart.generic((A, B) => { 13 functions.A2B$ = dart.generic((A, B) => {
14 const A2B = dart.typedef('A2B', () => dart.functionType(B, [A])); 14 const A2B = dart.typedef('A2B', () => dart.functionType(B, [A]));
15 return A2B; 15 return A2B;
16 }); 16 });
17 functions.A2B = functions.A2B$(); 17 functions.A2B = functions.A2B$();
18 functions.id = function(f) { 18 functions.id = function(f) {
19 return f; 19 return f;
20 }; 20 };
21 dart.fn(functions.id, () => dart.definiteFunctionType(functions.A2B$(functions .Foo, functions.Foo), [functions.A2B$(functions.Foo, functions.Foo)])); 21 dart.lazyFn(functions.id, () => [functions.A2B$(functions.Foo, functions.Foo), [functions.A2B$(functions.Foo, functions.Foo)]]);
22 functions.Foo = class Foo extends core.Object {}; 22 functions.Foo = class Foo extends core.Object {};
23 functions.main = function() { 23 functions.main = function() {
24 core.print(functions.bootstrap()[dartx.get](0)); 24 core.print(functions.bootstrap()[dartx.get](0));
25 }; 25 };
26 dart.fn(functions.main, dart.void, []); 26 dart.fn(functions.main, dart.void, []);
27 // Exports: 27 // Exports:
28 exports.functions = functions; 28 exports.functions = functions;
29 }); 29 });
OLDNEW
« no previous file with comments | « test/codegen/expect/closure.js ('k') | test/codegen/expect/unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698