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

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

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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 var cascade = dart.defineLibrary(cascade, {}); 1 var cascade = dart.defineLibrary(cascade, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 (function(exports, core) { 3 (function(exports, core) {
4 'use strict'; 4 'use strict';
5 class A extends core.Object { 5 class A extends core.Object {
6 A() { 6 A() {
7 this.x = null; 7 this.x = null;
8 } 8 }
9 } 9 }
10 function test_closure_with_mutate() { 10 function test_closure_with_mutate() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 let a = null, b = null; 42 let a = null, b = null;
43 a = new A(); 43 a = new A();
44 a.x = b = null; 44 a.x = b = null;
45 a.x = b = null; 45 a.x = b = null;
46 a = null; 46 a = null;
47 core.print(a); 47 core.print(a);
48 } 48 }
49 dart.fn(test_mutate_outside_cascade, dart.void, []); 49 dart.fn(test_mutate_outside_cascade, dart.void, []);
50 function test_VariableDeclaration_single() { 50 function test_VariableDeclaration_single() {
51 let a = []; 51 let a = [];
52 a[core.$length] = 2; 52 a.length = 2;
53 a[core.$add](42); 53 a[dartx.add](42);
54 core.print(a); 54 core.print(a);
55 } 55 }
56 dart.fn(test_VariableDeclaration_single, dart.void, []); 56 dart.fn(test_VariableDeclaration_single, dart.void, []);
57 function test_VariableDeclaration_last() { 57 function test_VariableDeclaration_last() {
58 let a = 42, b = (() => { 58 let a = 42, b = (() => {
59 let _ = []; 59 let _ = [];
60 _[core.$length] = 2; 60 _.length = 2;
61 _[core.$add](a); 61 _[dartx.add](a);
62 return _; 62 return _;
63 })(); 63 })();
64 core.print(b); 64 core.print(b);
65 } 65 }
66 dart.fn(test_VariableDeclaration_last, dart.void, []); 66 dart.fn(test_VariableDeclaration_last, dart.void, []);
67 function test_VariableDeclaration_first() { 67 function test_VariableDeclaration_first() {
68 let a = (() => { 68 let a = (() => {
69 let _ = []; 69 let _ = [];
70 _[core.$length] = 2; 70 _.length = 2;
71 _[core.$add](3); 71 _[dartx.add](3);
72 return _; 72 return _;
73 })(), b = 2; 73 })(), b = 2;
74 core.print(a); 74 core.print(a);
75 } 75 }
76 dart.fn(test_VariableDeclaration_first, dart.void, []); 76 dart.fn(test_VariableDeclaration_first, dart.void, []);
77 function test_increment() { 77 function test_increment() {
78 let a = new A(); 78 let a = new A();
79 let y = ((() => { 79 let y = ((() => {
80 a.x = dart.dsend(a.x, '+', 1); 80 a.x = dart.dsend(a.x, '+', 1);
81 a.x = dart.dsend(a.x, '-', 1); 81 a.x = dart.dsend(a.x, '-', 1);
82 return a; 82 return a;
83 })()); 83 })());
84 } 84 }
85 dart.fn(test_increment, dart.void, []); 85 dart.fn(test_increment, dart.void, []);
86 let Base$ = dart.generic(function(T) { 86 let Base$ = dart.generic(function(T) {
87 class Base extends core.Object { 87 class Base extends core.Object {
88 Base() { 88 Base() {
89 this.x = dart.setType([], core.List$(T)); 89 this.x = dart.list([], T);
90 } 90 }
91 } 91 }
92 return Base; 92 return Base;
93 }); 93 });
94 let Base = Base$(); 94 let Base = Base$();
95 class Foo extends Base$(core.int) { 95 class Foo extends Base$(core.int) {
96 Foo() { 96 Foo() {
97 super.Base(); 97 super.Base();
98 } 98 }
99 test_final_field_generic(t) { 99 test_final_field_generic(t) {
100 this.x[core.$add](1); 100 this.x[dartx.add](1);
101 this.x[core.$add](2); 101 this.x[dartx.add](2);
102 this.x[core.$add](3); 102 this.x[dartx.add](3);
103 this.x[core.$add](4); 103 this.x[dartx.add](4);
104 } 104 }
105 } 105 }
106 dart.setSignature(Foo, { 106 dart.setSignature(Foo, {
107 methods: () => ({test_final_field_generic: [dart.void, [core.Object]]}) 107 methods: () => ({test_final_field_generic: [dart.void, [core.Object]]})
108 }); 108 });
109 // Exports: 109 // Exports:
110 exports.A = A; 110 exports.A = A;
111 exports.test_closure_with_mutate = test_closure_with_mutate; 111 exports.test_closure_with_mutate = test_closure_with_mutate;
112 exports.test_closure_without_mutate = test_closure_without_mutate; 112 exports.test_closure_without_mutate = test_closure_without_mutate;
113 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; 113 exports.test_mutate_inside_cascade = test_mutate_inside_cascade;
114 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; 114 exports.test_mutate_outside_cascade = test_mutate_outside_cascade;
115 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; 115 exports.test_VariableDeclaration_single = test_VariableDeclaration_single;
116 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; 116 exports.test_VariableDeclaration_last = test_VariableDeclaration_last;
117 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; 117 exports.test_VariableDeclaration_first = test_VariableDeclaration_first;
118 exports.test_increment = test_increment; 118 exports.test_increment = test_increment;
119 exports.Base$ = Base$; 119 exports.Base$ = Base$;
120 exports.Base = Base; 120 exports.Base = Base;
121 exports.Foo = Foo; 121 exports.Foo = Foo;
122 })(cascade, core); 122 })(cascade, core);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698