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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/browser/runtime_tests.js ('k') | test/codegen/expect/functions.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/closure.js
diff --git a/test/codegen/expect/closure.js b/test/codegen/expect/closure.js
index 897bd7927d5e3fb427e93d71b004fec0e3d94b5c..c468e96fdf2fddbceed59ba08518d7ffea8e2f72 100644
--- a/test/codegen/expect/closure.js
+++ b/test/codegen/expect/closure.js
@@ -1,10 +1,12 @@
export const closure = Object.create(null);
import { core, js, dart, dartx } from 'dart_sdk';
-closure.generic_function = function<T>(items: core.List<T>, seed: T): core.List<T> {
- let strings = items[dartx.map](dart.fn((i: T): string => `${i}`, core.String, [dart.dynamic]))[dartx.toList]();
- return items;
+closure.generic_function = function(T) {
+ return (items: core.List<T>, seed: T): core.List<T> => {
+ let strings = items[dartx.map](core.String)(dart.fn((i: T): string => `${i}`, core.String, [T]))[dartx.toList]();
+ return items;
+ };
};
-dart.fn(closure.generic_function, core.List, [core.List, dart.dynamic]);
+dart.fn(closure.generic_function, T => [core.List$(T), [core.List$(T), T]]);
closure.Callback = dart.typedef('Callback', () => dart.functionType(dart.void, [], {i: core.int}));
closure.Foo$ = dart.generic(T => {
class Foo<T> extends core.Object {
« 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