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

Side by Side Diff: test/codegen/expect/closure.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/browser/runtime_tests.js ('k') | test/codegen/expect/functions.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 export const closure = Object.create(null); 1 export const closure = Object.create(null);
2 import { core, js, dart, dartx } from 'dart_sdk'; 2 import { core, js, dart, dartx } from 'dart_sdk';
3 closure.generic_function = function<T>(items: core.List<T>, seed: T): core.List< T> { 3 closure.generic_function = function(T) {
4 let strings = items[dartx.map](dart.fn((i: T): string => `${i}`, core.String, [dart.dynamic]))[dartx.toList](); 4 return (items: core.List<T>, seed: T): core.List<T> => {
5 return items; 5 let strings = items[dartx.map](core.String)(dart.fn((i: T): string => `${i}` , core.String, [T]))[dartx.toList]();
6 return items;
7 };
6 }; 8 };
7 dart.fn(closure.generic_function, core.List, [core.List, dart.dynamic]); 9 dart.fn(closure.generic_function, T => [core.List$(T), [core.List$(T), T]]);
8 closure.Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [ ], {i: core.int})); 10 closure.Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [ ], {i: core.int}));
9 closure.Foo$ = dart.generic(T => { 11 closure.Foo$ = dart.generic(T => {
10 class Foo<T> extends core.Object { 12 class Foo<T> extends core.Object {
11 i: number; 13 i: number;
12 b: boolean; 14 b: boolean;
13 s: string; 15 s: string;
14 v: T; 16 v: T;
15 static some_static_constant: string; 17 static some_static_constant: string;
16 static some_static_final: string; 18 static some_static_final: string;
17 static some_static_var: string; 19 static some_static_var: string;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 }); 92 });
91 closure.main = function(args): void { 93 closure.main = function(args): void {
92 }; 94 };
93 dart.fn(closure.main, dart.void, [dart.dynamic]); 95 dart.fn(closure.main, dart.void, [dart.dynamic]);
94 /** @final {string} */ 96 /** @final {string} */
95 closure.some_top_level_constant = "abc"; 97 closure.some_top_level_constant = "abc";
96 /** @final {string} */ 98 /** @final {string} */
97 closure.some_top_level_final = "abc"; 99 closure.some_top_level_final = "abc";
98 /** @type {string} */ 100 /** @type {string} */
99 closure.some_top_level_var = "abc"; 101 closure.some_top_level_var = "abc";
OLDNEW
« no previous file with comments | « test/browser/runtime_tests.js ('k') | test/codegen/expect/functions.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698