| OLD | NEW |
| 1 define(['dart_sdk', 'expect'], function(dart_sdk, expect) { | 1 define(['dart_sdk', 'expect'], function(dart_sdk, expect) { |
| 2 'use strict'; | 2 'use strict'; |
| 3 const core = dart_sdk.core; | 3 const core = dart_sdk.core; |
| 4 const dart = dart_sdk.dart; | 4 const dart = dart_sdk.dart; |
| 5 const dartx = dart_sdk.dartx; | 5 const dartx = dart_sdk.dartx; |
| 6 const minitest = expect.minitest; | 6 const minitest = expect.minitest; |
| 7 const identity_test = Object.create(null); | 7 const identity_test = Object.create(null); |
| 8 const $_get = dartx._get; |
| 8 let TToT = () => (TToT = dart.constFn(dart.gFnType(T => [T, [T]])))(); | 9 let TToT = () => (TToT = dart.constFn(dart.gFnType(T => [T, [T]])))(); |
| 9 let VoidToT = () => (VoidToT = dart.constFn(dart.gFnType(T => [T, []])))(); | 10 let VoidToT = () => (VoidToT = dart.constFn(dart.gFnType(T => [T, []])))(); |
| 10 let VoidToNull = () => (VoidToNull = dart.constFn(dart.fnType(core.Null, [])))
(); | 11 let VoidToNull = () => (VoidToNull = dart.constFn(dart.fnType(core.Null, [])))
(); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.fnType(dart.dynam
ic, [])))(); | 12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.fnType(dart.dynam
ic, [])))(); |
| 12 identity_test.Music = class Music extends core.Object { | 13 identity_test.Music = class Music extends core.Object { |
| 13 toString() { | 14 toString() { |
| 14 return { | 15 return { |
| 15 0: "Music.country", | 16 0: "Music.country", |
| 16 1: "Music.western" | 17 1: "Music.western" |
| 17 }[this.index]; | 18 }[this.index]; |
| 18 } | 19 } |
| 19 }; | 20 }; |
| 20 (identity_test.Music.new = function(x) { | 21 (identity_test.Music.new = function(x) { |
| 21 this.index = x; | 22 this.index = x; |
| 22 }).prototype = identity_test.Music.prototype; | 23 }).prototype = identity_test.Music.prototype; |
| 23 dart.setSignature(identity_test.Music, { | 24 dart.setSignature(identity_test.Music, { |
| 24 fields: () => ({index: dart.finalFieldType(core.int)}) | 25 fields: () => ({index: dart.finalFieldType(core.int)}) |
| 25 }); | 26 }); |
| 26 dart.defineEnumValues(identity_test.Music, [ | 27 dart.defineEnumValues(identity_test.Music, [ |
| 27 'country', | 28 'country', |
| 28 'western' | 29 'western' |
| 29 ]); | 30 ]); |
| 30 identity_test.BluesBrother = class BluesBrother extends core.Object {}; | 31 identity_test.BluesBrother = class BluesBrother extends core.Object {}; |
| 31 (identity_test.BluesBrother.new = function() { | 32 (identity_test.BluesBrother.new = function() { |
| 32 }).prototype = identity_test.BluesBrother.prototype; | 33 }).prototype = identity_test.BluesBrother.prototype; |
| 34 dart.addTypeTests(identity_test.BluesBrother); |
| 33 identity_test._Jake = class _Jake extends identity_test.BluesBrother {}; | 35 identity_test._Jake = class _Jake extends identity_test.BluesBrother {}; |
| 34 (identity_test._Jake.new = function() { | 36 (identity_test._Jake.new = function() { |
| 35 }).prototype = identity_test._Jake.prototype; | 37 }).prototype = identity_test._Jake.prototype; |
| 38 dart.addTypeTests(identity_test._Jake); |
| 36 identity_test._Elwood = class _Elwood extends identity_test.BluesBrother { | 39 identity_test._Elwood = class _Elwood extends identity_test.BluesBrother { |
| 37 ['=='](other) { | 40 ['=='](other) { |
| 38 return identity_test._Elwood.is(other); | 41 return identity_test._Elwood.is(other); |
| 39 } | 42 } |
| 40 }; | 43 }; |
| 41 (identity_test._Elwood.new = function() { | 44 (identity_test._Elwood.new = function() { |
| 42 }).prototype = identity_test._Elwood.prototype; | 45 }).prototype = identity_test._Elwood.prototype; |
| 46 dart.addTypeTests(identity_test._Elwood); |
| 43 dart.setSignature(identity_test._Elwood, { | 47 dart.setSignature(identity_test._Elwood, { |
| 44 methods: () => ({'==': dart.fnType(core.bool, [core.Object])}) | 48 methods: () => ({'==': dart.fnType(core.bool, [core.Object])}) |
| 45 }); | 49 }); |
| 46 identity_test._Norman = class _Norman extends identity_test.BluesBrother {}; | 50 identity_test._Norman = class _Norman extends identity_test.BluesBrother {}; |
| 47 (identity_test._Norman.new = function() { | 51 (identity_test._Norman.new = function() { |
| 48 }).prototype = identity_test._Norman.prototype; | 52 }).prototype = identity_test._Norman.prototype; |
| 53 dart.addTypeTests(identity_test._Norman); |
| 49 identity_test.hideNull = function(T) { | 54 identity_test.hideNull = function(T) { |
| 50 return x => { | 55 return x => { |
| 51 return x; | 56 return x; |
| 52 }; | 57 }; |
| 53 }; | 58 }; |
| 54 dart.fn(identity_test.hideNull, TToT()); | 59 dart.fn(identity_test.hideNull, TToT()); |
| 55 identity_test.getUndefined = function(T) { | 60 identity_test.getUndefined = function(T) { |
| 56 return () => { | 61 return () => { |
| 57 return T._check(core.List.new(1)[dartx._get](0)); | 62 return T._check(core.List.new(1)[$_get](0)); |
| 58 }; | 63 }; |
| 59 }; | 64 }; |
| 60 dart.fn(identity_test.getUndefined, VoidToT()); | 65 dart.fn(identity_test.getUndefined, VoidToT()); |
| 61 identity_test.main = function() { | 66 identity_test.main = function() { |
| 62 minitest.group('Enum identity', dart.fn(() => { | 67 minitest.group('Enum identity', dart.fn(() => { |
| 63 minitest.test('Identical enum/enum (nullable)', dart.fn(() => { | 68 minitest.test('Identical enum/enum (nullable)', dart.fn(() => { |
| 64 let e1 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.country); | 69 let e1 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.country); |
| 65 let e2 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.western); | 70 let e2 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.western); |
| 66 let d1 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.country); | 71 let d1 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.country); |
| 67 let d2 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.western); | 72 let d2 = identity_test.hideNull(identity_test.Music)(identity_test.Music
.western); |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 }; | 1145 }; |
| 1141 dart.fn(identity_test.main, VoidTodynamic()); | 1146 dart.fn(identity_test.main, VoidTodynamic()); |
| 1142 dart.trackLibraries("identity_test", { | 1147 dart.trackLibraries("identity_test", { |
| 1143 "identity_test.dart": identity_test | 1148 "identity_test.dart": identity_test |
| 1144 }, null); | 1149 }, null); |
| 1145 // Exports: | 1150 // Exports: |
| 1146 return { | 1151 return { |
| 1147 identity_test: identity_test | 1152 identity_test: identity_test |
| 1148 }; | 1153 }; |
| 1149 }); | 1154 }); |
| OLD | NEW |