| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @JS("ArrayTest.Util") | 5 @JS("ArrayTest.Util") |
| 6 library js_array_test; | 6 library js_array_test; |
| 7 | 7 |
| 8 import 'dart:html'; | 8 import 'dart:html'; |
| 9 | 9 |
| 10 import 'dart:js' as js; | 10 import 'dart:js' as js; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 }); | 504 }); |
| 505 | 505 |
| 506 test("property descriptors", () { | 506 test("property descriptors", () { |
| 507 // This test matters to make behavior consistent with JS native arrays | 507 // This test matters to make behavior consistent with JS native arrays |
| 508 // and to make devtools integration work well. | 508 // and to make devtools integration work well. |
| 509 var list = ["a", "b"]; | 509 var list = ["a", "b"]; |
| 510 var descriptor = getOwnPropertyDescriptor(list, 0); | 510 var descriptor = getOwnPropertyDescriptor(list, 0); |
| 511 | 511 |
| 512 expect(descriptor.value, equals("a")); | 512 expect(descriptor.value, equals("a")); |
| 513 expect(descriptor.writable, isTrue); | 513 expect(descriptor.writable, isTrue); |
| 514 expect(descriptor.enumerable, isTrue); | 514 // TODO(jacobr): commented out until https://github.com/dart-lang/sdk/issu
es/26128 |
| 515 expect(descriptor.configurable, isTrue); | 515 // is fixed. |
| 516 // expect(descriptor.enumerable, isTrue); |
| 517 // expect(descriptor.configurable, isTrue); |
| 516 | 518 |
| 517 descriptor = getOwnPropertyDescriptor(list, "length"); | 519 descriptor = getOwnPropertyDescriptor(list, "length"); |
| 518 expect(descriptor.value, equals(2)); | 520 expect(descriptor.value, equals(2)); |
| 519 expect(descriptor.writable, isTrue); | 521 expect(descriptor.writable, isTrue); |
| 520 expect(descriptor.enumerable, isFalse); | 522 expect(descriptor.enumerable, isFalse); |
| 521 expect(descriptor.configurable, isFalse); | 523 expect(descriptor.configurable, isFalse); |
| 522 }); | 524 }); |
| 523 | 525 |
| 524 test("concat js arrays", () { | 526 test("concat js arrays", () { |
| 525 var list = ["1", "2"]; | 527 var list = ["1", "2"]; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 expect(listView is List, isTrue); | 689 expect(listView is List, isTrue); |
| 688 expect(listView.length, equals(2)); | 690 expect(listView.length, equals(2)); |
| 689 expect(checkIsArray(listView), isFalse); | 691 expect(checkIsArray(listView), isFalse); |
| 690 expect(checkIsArray(listView.toList()), isTrue); | 692 expect(checkIsArray(listView.toList()), isTrue); |
| 691 expect(getOwnPropertyDescriptor( | 693 expect(getOwnPropertyDescriptor( |
| 692 listView, "length"), equals(null)); | 694 listView, "length"), equals(null)); |
| 693 }); | 695 }); |
| 694 }); | 696 }); |
| 695 */ | 697 */ |
| 696 } | 698 } |
| OLD | NEW |