OLD | NEW |
1 dart_library.library('misc', null, /* Imports */[ | 1 dart_library.library('misc', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart/_runtime', |
3 'dart/core' | 3 'dart/core' |
4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
5 ], function(exports, dart, core) { | 5 ], function(exports, dart, core) { |
6 'use strict'; | 6 'use strict'; |
7 let dartx = dart.dartx; | 7 let dartx = dart.dartx; |
8 class _Uninitialized extends core.Object { | 8 class _Uninitialized extends core.Object { |
9 _Uninitialized() { | 9 _Uninitialized() { |
10 } | 10 } |
(...skipping 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 return Generic; | 22 return Generic; |
23 }); | 23 }); |
24 let Generic = Generic$(); | 24 let Generic = Generic$(); |
25 class Base extends core.Object { | 25 class Base extends core.Object { |
26 Base() { | 26 Base() { |
27 this.x = 1; | 27 this.x = 1; |
28 this.y = 2; | 28 this.y = 2; |
29 } | 29 } |
30 ['=='](obj) { | 30 ['=='](obj) { |
31 return dart.is(obj, Base) && dart.equals(dart.dload(obj, 'x'), this.x) &&
dart.equals(dart.dload(obj, 'y'), this.y); | 31 return dart.is(obj, Base) && obj.x == this.x && obj.y == this.y; |
32 } | 32 } |
33 } | 33 } |
34 class Derived extends core.Object { | 34 class Derived extends core.Object { |
35 Derived() { | 35 Derived() { |
36 this.z = 3; | 36 this.z = 3; |
37 } | 37 } |
38 ['=='](obj) { | 38 ['=='](obj) { |
39 return dart.is(obj, Derived) && dart.equals(dart.dload(obj, 'z'), this.z)
&& super['=='](obj); | 39 return dart.is(obj, Derived) && obj.z == this.z && super['=='](obj); |
40 } | 40 } |
41 } | 41 } |
42 function _isWhitespace(ch) { | 42 function _isWhitespace(ch) { |
43 return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; | 43 return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; |
44 } | 44 } |
45 dart.fn(_isWhitespace, core.bool, [core.String]); | 45 dart.fn(_isWhitespace, core.bool, [core.String]); |
46 const expr = 'foo'; | 46 const expr = 'foo'; |
47 const _escapeMap = dart.const(dart.map({'\n': '\\n', '\r': '\\r', '\f': '\\f',
'\b': '\\b', '\t': '\\t', '\v': '\\v', '': '\\x7F', [`\${${expr}}`]: ''})); | 47 const _escapeMap = dart.const(dart.map({'\n': '\\n', '\r': '\\r', '\f': '\\f',
'\b': '\\b', '\t': '\\t', '\v': '\\v', '': '\\x7F', [`\${${expr}}`]: ''})); |
48 function main() { | 48 function main() { |
49 core.print(dart.toString(1)); | 49 core.print(dart.toString(1)); |
50 core.print(dart.toString(1.0)); | 50 core.print(dart.toString(1.0)); |
51 core.print(dart.toString(1.1)); | 51 core.print(dart.toString(1.1)); |
52 let x = 42; | 52 let x = 42; |
53 core.print(dart.equals(x, dart.dynamic)); | 53 core.print(dart.equals(x, dart.dynamic)); |
54 core.print(dart.equals(x, Generic)); | 54 core.print(dart.equals(x, Generic)); |
55 core.print(new (Generic$(core.int))().type); | 55 core.print(new (Generic$(core.int))().type); |
56 core.print(dart.equals(new Derived(), new Derived())); | 56 core.print(dart.equals(new Derived(), new Derived())); |
57 } | 57 } |
58 dart.fn(main); | 58 dart.fn(main); |
59 // Exports: | 59 // Exports: |
60 exports.UNINITIALIZED = UNINITIALIZED; | 60 exports.UNINITIALIZED = UNINITIALIZED; |
61 exports.Generic$ = Generic$; | 61 exports.Generic$ = Generic$; |
62 exports.Generic = Generic; | 62 exports.Generic = Generic; |
63 exports.Base = Base; | 63 exports.Base = Base; |
64 exports.Derived = Derived; | 64 exports.Derived = Derived; |
65 exports.expr = expr; | 65 exports.expr = expr; |
66 exports.main = main; | 66 exports.main = main; |
67 }); | 67 }); |
OLD | NEW |