| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library jsTest; | 5 library jsTest; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 import 'dart:typed_data' show ByteBuffer, Int32List; | 9 import 'dart:typed_data' show ByteBuffer, Int32List; |
| 10 import 'dart:indexed_db' show IdbFactory, KeyRange; | 10 import 'dart:indexed_db' show IdbFactory, KeyRange; |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 expect(context.callMethod('isPropertyInstanceOf', | 508 expect(context.callMethod('isPropertyInstanceOf', |
| 509 ['a', context['Array']]), isTrue); | 509 ['a', context['Array']]), isTrue); |
| 510 var a = context['a']; | 510 var a = context['a']; |
| 511 expect(a, new isInstanceOf<JsArray>()); | 511 expect(a, new isInstanceOf<JsArray>()); |
| 512 expect(a, [1, 2, 3]); | 512 expect(a, [1, 2, 3]); |
| 513 context.deleteProperty('a'); | 513 context.deleteProperty('a'); |
| 514 }); | 514 }); |
| 515 | 515 |
| 516 test('pass Array to JS', () { | 516 test('pass Array to JS', () { |
| 517 context['a'] = [1, 2, 3]; | 517 context['a'] = [1, 2, 3]; |
| 518 expect(context.callMethod('isPropertyInstanceOf', | |
| 519 ['a', context['Array']]), isTrue); | |
| 520 var a = context['a']; | 518 var a = context['a']; |
| 521 expect(a, new isInstanceOf<List>()); | 519 expect(a, new isInstanceOf<List>()); |
| 522 expect(a, isNot(new isInstanceOf<JsArray>())); | 520 expect(a, isNot(new isInstanceOf<JsArray>())); |
| 523 expect(a, [1, 2, 3]); | 521 expect(a, [1, 2, 3]); |
| 524 context.deleteProperty('a'); | 522 context.deleteProperty('a'); |
| 525 }); | 523 }); |
| 526 | 524 |
| 527 test('[]', () { | 525 test('[]', () { |
| 528 var array = new JsArray.from([1, 2]); | 526 var array = new JsArray.from([1, 2]); |
| 529 expect(array[0], 1); | 527 expect(array[0], 1); |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 // expect(context.callMethod('isPropertyInstanceOf', ['o', listType]), | 1016 // expect(context.callMethod('isPropertyInstanceOf', ['o', listType]), |
| 1019 // isTrue); | 1017 // isTrue); |
| 1020 context.deleteProperty('o'); | 1018 context.deleteProperty('o'); |
| 1021 } | 1019 } |
| 1022 }); | 1020 }); |
| 1023 | 1021 |
| 1024 }); | 1022 }); |
| 1025 }); | 1023 }); |
| 1026 | 1024 |
| 1027 } | 1025 } |
| OLD | NEW |