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

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

Issue 1988613006: Eliminate unnecessary covariance checks. (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 | « lib/src/compiler/code_generator.dart ('k') | test/codegen/expect/covariance.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) { 3 closure.generic_function = function(T) {
4 return (items: core.List<T>, seed: T): core.List<T> => { 4 return (items: core.List<T>, seed: T): core.List<T> => {
5 let strings = items[dartx.map](core.String)(dart.fn((i: T): string => `${i}` , core.String, [T]))[dartx.toList](); 5 let strings = items[dartx.map](core.String)(dart.fn((i: T): string => `${i}` , core.String, [T]))[dartx.toList]();
6 return items; 6 return items;
7 }; 7 };
8 }; 8 };
9 dart.fn(closure.generic_function, T => [core.List$(T), [core.List$(T), T]]); 9 dart.fn(closure.generic_function, T => [core.List$(T), [core.List$(T), T]]);
10 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}));
(...skipping 20 matching lines...) Expand all
31 dart.as(t, T); 31 dart.as(t, T);
32 return t; 32 return t;
33 } 33 }
34 typed_method(foo: closure.Foo<any>, list: core.List<any>, i: number, n: numb er, d: number, b: boolean, s: string, a: any[], o: Object, f: Function) { 34 typed_method(foo: closure.Foo<any>, list: core.List<any>, i: number, n: numb er, d: number, b: boolean, s: string, a: any[], o: Object, f: Function) {
35 return ''; 35 return '';
36 } 36 }
37 optional_params(a, b = null, c: number = null) {} 37 optional_params(a, b = null, c: number = null) {}
38 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {} 38 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {}
39 nullary_method() {} 39 nullary_method() {}
40 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) { 40 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) {
41 dart.as(f, dart.functionType(core.int, [dart.dynamic], [dart.dynamic]));
42 dart.as(g, dart.functionType(dart.dynamic, [dart.dynamic], {y: core.String , z: dart.dynamic}));
43 cb({i: this.i}); 41 cb({i: this.i});
44 } 42 }
45 run(a: core.List<any>, b: string, c: (d: string) => core.List<any>, e: (f: ( g: any) => any) => core.List<number>, {h = null}: {h?: core.Map<core.Map<any, an y>, core.Map<any, any>>} = {}) { 43 run(a: core.List<any>, b: string, c: (d: string) => core.List<any>, e: (f: ( g: any) => any) => core.List<number>, {h = null}: {h?: core.Map<core.Map<any, an y>, core.Map<any, any>>} = {}) {}
46 dart.as(c, dart.functionType(core.List, [core.String]));
47 dart.as(e, dart.functionType(core.List$(core.int), [dart.functionType(dart .dynamic, [dart.dynamic])]));
48 }
49 get prop() { 44 get prop() {
50 return null; 45 return null;
51 } 46 }
52 set prop(value: string) {} 47 set prop(value: string) {}
53 static get staticProp() { 48 static get staticProp() {
54 return null; 49 return null;
55 } 50 }
56 static set staticProp(value: string) {} 51 static set staticProp(value: string) {}
57 } 52 }
58 dart.setSignature(Foo, { 53 dart.setSignature(Foo, {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 }); 87 });
93 closure.main = function(args): void { 88 closure.main = function(args): void {
94 }; 89 };
95 dart.fn(closure.main, dart.void, [dart.dynamic]); 90 dart.fn(closure.main, dart.void, [dart.dynamic]);
96 /** @final {string} */ 91 /** @final {string} */
97 closure.some_top_level_constant = "abc"; 92 closure.some_top_level_constant = "abc";
98 /** @final {string} */ 93 /** @final {string} */
99 closure.some_top_level_final = "abc"; 94 closure.some_top_level_final = "abc";
100 /** @type {string} */ 95 /** @type {string} */
101 closure.some_top_level_var = "abc"; 96 closure.some_top_level_var = "abc";
OLDNEW
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | test/codegen/expect/covariance.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698