| OLD | NEW |
| 1 dart_library.library('cascade', null, /* Imports */[ | 1 dart_library.library('cascade', null, /* Imports */[ |
| 2 'dart/_runtime', | 2 'dart_sdk' |
| 3 'dart/core' | 3 ], function(exports, dart_sdk) { |
| 4 ], /* Lazy imports */[ | |
| 5 ], function(exports, dart, core) { | |
| 6 'use strict'; | 4 'use strict'; |
| 7 let dartx = dart.dartx; | 5 const core = dart_sdk.core; |
| 8 class A extends core.Object { | 6 const dart = dart_sdk.dart; |
| 7 const dartx = dart_sdk.dartx; |
| 8 const cascade = Object.create(null); |
| 9 cascade.A = class A extends core.Object { |
| 9 A() { | 10 A() { |
| 10 this.x = null; | 11 this.x = null; |
| 11 } | 12 } |
| 12 } | 13 }; |
| 13 function test_closure_with_mutate() { | 14 cascade.test_closure_with_mutate = function() { |
| 14 let a = new A(); | 15 let a = new cascade.A(); |
| 15 a.x = dart.fn(() => { | 16 a.x = dart.fn(() => { |
| 16 core.print("hi"); | 17 core.print("hi"); |
| 17 a = null; | 18 a = null; |
| 18 }); | 19 }); |
| 19 let _ = a; | 20 let _ = a; |
| 20 dart.dcall(_.x); | 21 dart.dcall(_.x); |
| 21 dart.dcall(_.x); | 22 dart.dcall(_.x); |
| 22 core.print(a); | 23 core.print(a); |
| 23 } | 24 }; |
| 24 dart.fn(test_closure_with_mutate, dart.void, []); | 25 dart.fn(cascade.test_closure_with_mutate, dart.void, []); |
| 25 function test_closure_without_mutate() { | 26 cascade.test_closure_without_mutate = function() { |
| 26 let a = new A(); | 27 let a = new cascade.A(); |
| 27 a.x = dart.fn(() => { | 28 a.x = dart.fn(() => { |
| 28 core.print(a); | 29 core.print(a); |
| 29 }); | 30 }); |
| 30 dart.dcall(a.x); | 31 dart.dcall(a.x); |
| 31 dart.dcall(a.x); | 32 dart.dcall(a.x); |
| 32 core.print(a); | 33 core.print(a); |
| 33 } | 34 }; |
| 34 dart.fn(test_closure_without_mutate, dart.void, []); | 35 dart.fn(cascade.test_closure_without_mutate, dart.void, []); |
| 35 function test_mutate_inside_cascade() { | 36 cascade.test_mutate_inside_cascade = function() { |
| 36 let a = null; | 37 let a = null; |
| 37 let _ = new A(); | 38 let _ = new cascade.A(); |
| 38 _.x = a = null; | 39 _.x = a = null; |
| 39 _.x = a = null; | 40 _.x = a = null; |
| 40 a = _; | 41 a = _; |
| 41 core.print(a); | 42 core.print(a); |
| 42 } | 43 }; |
| 43 dart.fn(test_mutate_inside_cascade, dart.void, []); | 44 dart.fn(cascade.test_mutate_inside_cascade, dart.void, []); |
| 44 function test_mutate_outside_cascade() { | 45 cascade.test_mutate_outside_cascade = function() { |
| 45 let a = null, b = null; | 46 let a = null, b = null; |
| 46 a = new A(); | 47 a = new cascade.A(); |
| 47 a.x = b = null; | 48 a.x = b = null; |
| 48 a.x = b = null; | 49 a.x = b = null; |
| 49 a = null; | 50 a = null; |
| 50 core.print(a); | 51 core.print(a); |
| 51 } | 52 }; |
| 52 dart.fn(test_mutate_outside_cascade, dart.void, []); | 53 dart.fn(cascade.test_mutate_outside_cascade, dart.void, []); |
| 53 function test_VariableDeclaration_single() { | 54 cascade.test_VariableDeclaration_single = function() { |
| 54 let a = []; | 55 let a = []; |
| 55 a[dartx.length] = 2; | 56 a[dartx.length] = 2; |
| 56 a[dartx.add](42); | 57 a[dartx.add](42); |
| 57 core.print(a); | 58 core.print(a); |
| 58 } | 59 }; |
| 59 dart.fn(test_VariableDeclaration_single, dart.void, []); | 60 dart.fn(cascade.test_VariableDeclaration_single, dart.void, []); |
| 60 function test_VariableDeclaration_last() { | 61 cascade.test_VariableDeclaration_last = function() { |
| 61 let a = 42, b = (() => { | 62 let a = 42, b = (() => { |
| 62 let _ = []; | 63 let _ = []; |
| 63 _[dartx.length] = 2; | 64 _[dartx.length] = 2; |
| 64 _[dartx.add](a); | 65 _[dartx.add](a); |
| 65 return _; | 66 return _; |
| 66 })(); | 67 })(); |
| 67 core.print(b); | 68 core.print(b); |
| 68 } | 69 }; |
| 69 dart.fn(test_VariableDeclaration_last, dart.void, []); | 70 dart.fn(cascade.test_VariableDeclaration_last, dart.void, []); |
| 70 function test_VariableDeclaration_first() { | 71 cascade.test_VariableDeclaration_first = function() { |
| 71 let a = (() => { | 72 let a = (() => { |
| 72 let _ = []; | 73 let _ = []; |
| 73 _[dartx.length] = 2; | 74 _[dartx.length] = 2; |
| 74 _[dartx.add](3); | 75 _[dartx.add](3); |
| 75 return _; | 76 return _; |
| 76 })(), b = 2; | 77 })(), b = 2; |
| 77 core.print(a); | 78 core.print(a); |
| 78 } | 79 }; |
| 79 dart.fn(test_VariableDeclaration_first, dart.void, []); | 80 dart.fn(cascade.test_VariableDeclaration_first, dart.void, []); |
| 80 function test_increment() { | 81 cascade.test_increment = function() { |
| 81 let a = new A(); | 82 let a = new cascade.A(); |
| 82 let y = ((() => { | 83 let y = ((() => { |
| 83 a.x = dart.dsend(a.x, '+', 1); | 84 a.x = dart.dsend(a.x, '+', 1); |
| 84 a.x = dart.dsend(a.x, '-', 1); | 85 a.x = dart.dsend(a.x, '-', 1); |
| 85 return a; | 86 return a; |
| 86 })()); | 87 })()); |
| 87 } | 88 }; |
| 88 dart.fn(test_increment, dart.void, []); | 89 dart.fn(cascade.test_increment, dart.void, []); |
| 89 const Base$ = dart.generic(function(T) { | 90 cascade.Base$ = dart.generic(T => { |
| 90 class Base extends core.Object { | 91 class Base extends core.Object { |
| 91 Base() { | 92 Base() { |
| 92 this.x = dart.list([], T); | 93 this.x = dart.list([], T); |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 return Base; | 96 return Base; |
| 96 }); | 97 }); |
| 97 let Base = Base$(); | 98 cascade.Base = cascade.Base$(); |
| 98 class Foo extends Base$(core.int) { | 99 cascade.Foo = class Foo extends cascade.Base$(core.int) { |
| 99 Foo() { | 100 Foo() { |
| 100 super.Base(); | 101 super.Base(); |
| 101 } | 102 } |
| 102 test_final_field_generic(t) { | 103 test_final_field_generic(t) { |
| 103 this.x[dartx.add](1); | 104 this.x[dartx.add](1); |
| 104 this.x[dartx.add](2); | 105 this.x[dartx.add](2); |
| 105 this.x[dartx.add](3); | 106 this.x[dartx.add](3); |
| 106 this.x[dartx.add](4); | 107 this.x[dartx.add](4); |
| 107 } | 108 } |
| 108 } | 109 }; |
| 109 dart.setSignature(Foo, { | 110 dart.setSignature(cascade.Foo, { |
| 110 methods: () => ({test_final_field_generic: [dart.void, [dart.dynamic]]}) | 111 methods: () => ({test_final_field_generic: [dart.void, [dart.dynamic]]}) |
| 111 }); | 112 }); |
| 112 // Exports: | 113 // Exports: |
| 113 exports.A = A; | 114 exports.cascade = cascade; |
| 114 exports.test_closure_with_mutate = test_closure_with_mutate; | |
| 115 exports.test_closure_without_mutate = test_closure_without_mutate; | |
| 116 exports.test_mutate_inside_cascade = test_mutate_inside_cascade; | |
| 117 exports.test_mutate_outside_cascade = test_mutate_outside_cascade; | |
| 118 exports.test_VariableDeclaration_single = test_VariableDeclaration_single; | |
| 119 exports.test_VariableDeclaration_last = test_VariableDeclaration_last; | |
| 120 exports.test_VariableDeclaration_first = test_VariableDeclaration_first; | |
| 121 exports.test_increment = test_increment; | |
| 122 exports.Base$ = Base$; | |
| 123 exports.Base = Base; | |
| 124 exports.Foo = Foo; | |
| 125 }); | 115 }); |
| OLD | NEW |