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

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

Issue 2781443003: Fix #28120, strong mode allows field overrides (Closed)
Patch Set: fix Created 3 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 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.functionType(core .int, [dart.dynamic], [dart.dynamic])))(); 3 let dynamic__Toint = () => (dynamic__Toint = dart.constFn(dart.functionType(core .int, [dart.dynamic], [dart.dynamic])))();
4 let dynamic__Todynamic = () => (dynamic__Todynamic = dart.constFn(dart.functionT ype(dart.dynamic, [dart.dynamic], {y: core.String, z: dart.dynamic})))(); 4 let dynamic__Todynamic = () => (dynamic__Todynamic = dart.constFn(dart.functionT ype(dart.dynamic, [dart.dynamic], {y: core.String, z: dart.dynamic})))();
5 let StringToList = () => (StringToList = dart.constFn(dart.functionType(core.Lis t, [core.String])))(); 5 let StringToList = () => (StringToList = dart.constFn(dart.functionType(core.Lis t, [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.functionType( dart.dynamic, [dart.dynamic])))(); 7 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.functionType( dart.dynamic, [dart.dynamic])))();
8 let FnToListOfint = () => (FnToListOfint = dart.constFn(dart.functionType(ListOf int(), [dynamicTodynamic()])))(); 8 let FnToListOfint = () => (FnToListOfint = dart.constFn(dart.functionType(ListOf int(), [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 11 matching lines...) Expand all
22 closure.Foo$ = dart.generic(T => { 22 closure.Foo$ = dart.generic(T => {
23 let FooOfT = () => (FooOfT = dart.constFn(closure.Foo$(T)))(); 23 let FooOfT = () => (FooOfT = dart.constFn(closure.Foo$(T)))();
24 class Foo<T> extends core.Object { 24 class Foo<T> extends core.Object {
25 i: number; 25 i: number;
26 b: boolean; 26 b: boolean;
27 s: string; 27 s: string;
28 v: T; 28 v: T;
29 static some_static_constant: string; 29 static some_static_constant: string;
30 static some_static_final: string; 30 static some_static_final: string;
31 static some_static_var: string; 31 static some_static_var: string;
32 get i() {
33 return this[i$];
34 }
35 set i(value) {
36 super.i = value;
37 }
38 get b() {
39 return this[b];
40 }
41 set b(value) {
42 this[b] = value;
43 }
44 get s() {
45 return this[s];
46 }
47 set s(value) {
48 this[s] = value;
49 }
50 get v() {
51 return this[v$];
52 }
53 set v(value) {
54 this[v$] = value;
55 }
32 new(i: number, v: T) { 56 new(i: number, v: T) {
33 this.i = i; 57 this[i$] = i;
34 this.v = v; 58 this[v$] = v;
35 this.b = null; 59 this[b] = null;
36 this.s = null; 60 this[s] = null;
37 } 61 }
38 static build() { 62 static build() {
39 return new (FooOfT())(1, null); 63 return new (FooOfT())(1, null);
40 } 64 }
41 untyped_method(a, b) {} 65 untyped_method(a, b) {}
42 pass(t: T) { 66 pass(t: T) {
43 T._check(t); 67 T._check(t);
44 return t; 68 return t;
45 } 69 }
46 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) { 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) {
47 return ''; 71 return '';
48 } 72 }
49 optional_params(a, b = null, c: number = null) {} 73 optional_params(a, b = null, c: number = null) {}
50 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {} 74 static named_params(a, {b = null, c = null}: {b?: any, c?: number} = {}) {}
51 nullary_method() {} 75 nullary_method() {}
52 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) { 76 function_params(f: (x: any, y?: any) => number, g: (x: any, opts?: {y?: stri ng, z?: any}) => any, cb: closure.Callback) {
53 cb({i: this.i}); 77 cb({i: this.i});
54 } 78 }
55 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>>} = {}) {} 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>>} = {}) {}
56 get prop() { 80 get prop() {
57 return null; 81 return null;
58 } 82 }
59 set prop(value: string) {} 83 set prop(value: string) {}
60 static get staticProp() { 84 static get staticProp() {
61 return null; 85 return null;
62 } 86 }
63 static set staticProp(value: string) {} 87 static set staticProp(value: string) {}
64 } 88 }
65 dart.addTypeTests(Foo); 89 dart.addTypeTests(Foo);
90 const i$ = Symbol("Foo.i");
91 const b = Symbol("Foo.b");
92 const s = Symbol("Foo.s");
93 const v$ = Symbol("Foo.v");
66 dart.setSignature(Foo, { 94 dart.setSignature(Foo, {
67 fields: () => ({ 95 fields: () => ({
68 i: core.int, 96 i: core.int,
69 b: core.bool, 97 b: core.bool,
70 s: core.String, 98 s: core.String,
71 v: T 99 v: T
72 }), 100 }),
73 getters: () => ({prop: dart.definiteFunctionType(core.String, [])}), 101 getters: () => ({prop: dart.definiteFunctionType(core.String, [])}),
74 setters: () => ({prop: dart.definiteFunctionType(dart.void, [core.String])}) , 102 setters: () => ({prop: dart.definiteFunctionType(dart.void, [core.String])}) ,
75 methods: () => ({ 103 methods: () => ({
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 }, 139 },
112 set closure(_) {} 140 set closure(_) {}
113 }); 141 });
114 /** @final {string} */ 142 /** @final {string} */
115 closure.some_top_level_constant = "abc"; 143 closure.some_top_level_constant = "abc";
116 /** @final {string} */ 144 /** @final {string} */
117 closure.some_top_level_final = "abc"; 145 closure.some_top_level_final = "abc";
118 /** @type {string} */ 146 /** @type {string} */
119 closure.some_top_level_var = "abc"; 147 closure.some_top_level_var = "abc";
120 dart.trackLibraries("closure", {"closure.dart": closure}, null); 148 dart.trackLibraries("closure", {"closure.dart": closure}, null);
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/codegen_expected/BenchmarkBase.js ('k') | pkg/dev_compiler/test/codegen_expected/sunflower/sunflower.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698