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

Side by Side Diff: pkg/dev_compiler/test/codegen_expected/closure.js

Issue 2934623003: fix #29753, use ES5 constructors for ddc (Closed)
Patch Set: rebase Created 3 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 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 let dynamic__Toint = () => (dynamic__Toint = dart.constFn(dart.fnTypeFuzzy(core. int, [dart.dynamic], [dart.dynamic])))(); 3 let dynamic__Toint = () => (dynamic__Toint = dart.constFn(dart.fnTypeFuzzy(core. int, [dart.dynamic], [dart.dynamic])))();
4 let dynamic__Todynamic = () => (dynamic__Todynamic = dart.constFn(dart.fnTypeFuz zy(dart.dynamic, [dart.dynamic], {y: core.String, z: dart.dynamic})))(); 4 let dynamic__Todynamic = () => (dynamic__Todynamic = dart.constFn(dart.fnTypeFuz zy(dart.dynamic, [dart.dynamic], {y: core.String, z: dart.dynamic})))();
5 let StringToList = () => (StringToList = dart.constFn(dart.fnTypeFuzzy(core.List , [core.String])))(); 5 let StringToList = () => (StringToList = dart.constFn(dart.fnTypeFuzzy(core.List , [core.String])))();
6 let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))(); 6 let ListOfint = () => (ListOfint = dart.constFn(core.List$(core.int)))();
7 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.fnTypeFuzzy(d art.dynamic, [dart.dynamic])))(); 7 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.fnTypeFuzzy(d art.dynamic, [dart.dynamic])))();
8 let FnToListOfint = () => (FnToListOfint = dart.constFn(dart.fnTypeFuzzy(ListOfi nt(), [dynamicTodynamic()])))(); 8 let FnToListOfint = () => (FnToListOfint = dart.constFn(dart.fnTypeFuzzy(ListOfi nt(), [dynamicTodynamic()])))();
9 let MapOfMap$Map = () => (MapOfMap$Map = dart.constFn(core.Map$(core.Map, core.M ap)))(); 9 let MapOfMap$Map = () => (MapOfMap$Map = dart.constFn(core.Map$(core.Map, core.M ap)))();
10 let Foo = () => (Foo = dart.constFn(closure.Foo$()))(); 10 let Foo = () => (Foo = dart.constFn(closure.Foo$()))();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 set s(value) { 47 set s(value) {
48 this[s] = value; 48 this[s] = value;
49 } 49 }
50 get v() { 50 get v() {
51 return this[v$]; 51 return this[v$];
52 } 52 }
53 set v(value) { 53 set v(value) {
54 this[v$] = value; 54 this[v$] = value;
55 } 55 }
56 new(i: number, v: T) {
57 this[i$] = i;
58 this[v$] = v;
59 this[b] = null;
60 this[s] = null;
61 }
62 static build() { 56 static build() {
63 return new (FooOfT())(1, null); 57 return new (FooOfT()).new(1, null);
64 } 58 }
65 untyped_method(a, b) {} 59 untyped_method(a, b) {}
66 pass(t: T) { 60 pass(t: T) {
67 T._check(t); 61 T._check(t);
68 return t; 62 return t;
69 } 63 }
70 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) { 64 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) {
71 return ''; 65 return '';
72 } 66 }
73 optional_params(a, b = null, c: number = null) {} 67 optional_params(a, b = null, c: number = null) {}
74 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {} 68 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {}
75 nullary_method() {} 69 nullary_method() {}
76 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) { 70 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) {
77 cb({i: this.i}); 71 cb({i: this.i});
78 } 72 }
79 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>>} = {}) {} 73 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>>} = {}) {}
80 get prop() { 74 get prop() {
81 return null; 75 return null;
82 } 76 }
83 set prop(value: string) {} 77 set prop(value: string) {}
84 static get staticProp() { 78 static get staticProp() {
85 return null; 79 return null;
86 } 80 }
87 static set staticProp(value: string) {} 81 static set staticProp(value: string) {}
88 } 82 }
83 (Foo.new = function(i: number, v: T) {
84 this[i$] = i;
85 this[v$] = v;
86 this[b] = null;
87 this[s] = null;
88 }).prototype = Foo.prototype;
89 dart.addTypeTests(Foo); 89 dart.addTypeTests(Foo);
90 const i$ = Symbol("Foo.i"); 90 const i$ = Symbol("Foo.i");
91 const b = Symbol("Foo.b"); 91 const b = Symbol("Foo.b");
92 const s = Symbol("Foo.s"); 92 const s = Symbol("Foo.s");
93 const v$ = Symbol("Foo.v"); 93 const v$ = Symbol("Foo.v");
94 dart.setSignature(Foo, { 94 dart.setSignature(Foo, {
95 fields: () => ({ 95 fields: () => ({
96 i: dart.finalFieldType(core.int), 96 i: dart.finalFieldType(core.int),
97 b: dart.fieldType(core.bool), 97 b: dart.fieldType(core.bool),
98 s: dart.fieldType(core.String), 98 s: dart.fieldType(core.String),
(...skipping 22 matching lines...) Expand all
121 }, 121 },
122 get some_static_final() { 122 get some_static_final() {
123 return "abc"; 123 return "abc";
124 }, 124 },
125 get some_static_var() { 125 get some_static_var() {
126 return "abc"; 126 return "abc";
127 }, 127 },
128 set some_static_var(_) {} 128 set some_static_var(_) {}
129 }); 129 });
130 closure.Bar = class Bar extends core.Object {}; 130 closure.Bar = class Bar extends core.Object {};
131 closure.Baz = class Baz extends dart.mixin(closure.Foo$(core.int), closure.Bar) { 131 (closure.Bar.new = function() {
132 new(i: number) { 132 }).prototype = closure.Bar.prototype;
133 super.new(i, 123); 133 closure.Baz = class Baz extends dart.mixin(closure.Foo$(core.int), closure.Bar) {};
134 } 134 (closure.Baz.new = function(i: number) {
135 }; 135 closure.Baz.__proto__.new.call(this, i, 123);
136 }).prototype = closure.Baz.prototype;
136 dart.addSimpleTypeTests(closure.Baz); 137 dart.addSimpleTypeTests(closure.Baz);
137 closure.main = function(args): void { 138 closure.main = function(args): void {
138 }; 139 };
139 dart.fn(closure.main, dynamicTovoid()); 140 dart.fn(closure.main, dynamicTovoid());
140 dart.defineLazy(closure, { 141 dart.defineLazy(closure, {
141 get closure() { 142 get closure() {
142 return dart.fn((): core.Null => { 143 return dart.fn((): core.Null => {
143 return; 144 return;
144 }, VoidToNull()); 145 }, VoidToNull());
145 }, 146 },
146 set closure(_) {}, 147 set closure(_) {},
147 get some_top_level_constant() { 148 get some_top_level_constant() {
148 return "abc"; 149 return "abc";
149 }, 150 },
150 get some_top_level_final() { 151 get some_top_level_final() {
151 return "abc"; 152 return "abc";
152 }, 153 },
153 get some_top_level_var() { 154 get some_top_level_var() {
154 return "abc"; 155 return "abc";
155 }, 156 },
156 set some_top_level_var(_) {} 157 set some_top_level_var(_) {}
157 }); 158 });
158 dart.trackLibraries("closure", { 159 dart.trackLibraries("closure", {
159 "closure.dart": closure 160 "closure.dart": closure
160 }, null); 161 }, null);
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js ('k') | pkg/dev_compiler/test/codegen_expected/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698