Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Unified Diff: tests/html/js_array_test.dart

Issue 1408453003: Fix JavaScript property ordering issue that was breaking js_array_test on FireFox (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_array_test.dart
diff --git a/tests/html/js_array_test.dart b/tests/html/js_array_test.dart
index 039535eac1ac6b76156f25295e8861078b82b839..58d42db7489d6990c7feb8d4bb3e2ff3977fa574 100644
--- a/tests/html/js_array_test.dart
+++ b/tests/html/js_array_test.dart
@@ -130,8 +130,8 @@ ArrayTest.Util = {
0);
},
- getOwnPropertyDescriptorJson: function(array, property) {
- return JSON.stringify(Object.getOwnPropertyDescriptor(array, property));
+ getOwnPropertyDescriptor: function(array, property) {
+ return Object.getOwnPropertyDescriptor(array, property);
},
setLength: function(array, len) {
@@ -160,6 +160,14 @@ ArrayTest.Util = {
}
@Js()
+class PropertyDescriptor {
+ external get value;
+ external bool get writable;
+ external bool get enumerable;
+ external bool get configurable;
+}
+
+@Js()
class SimpleJsLiteralClass {
external get foo;
}
@@ -230,7 +238,7 @@ external reduceSumDoubledElements(List array);
external reduceRightSumDoubledElements(List array);
@Js()
-external getOwnPropertyDescriptorJson(List array, property);
+external PropertyDescriptor getOwnPropertyDescriptor(obj, property);
@Js("setLength")
external callSetLength(List array, length);
@@ -499,18 +507,18 @@ main() {
// This test matters to make behavior consistent with JS native arrays
// and to make devtools integration work well.
var list = ["a", "b"];
- expect(getOwnPropertyDescriptorJson(list, 0),
- equals('{"value":"a",'
- '"writable":true,'
- '"enumerable":true,'
- '"configurable":true}'));
+ var descriptor = getOwnPropertyDescriptor(list, 0);
- expect(
- getOwnPropertyDescriptorJson(list, "length"),
- equals('{"value":2,'
- '"writable":true,'
- '"enumerable":false,'
- '"configurable":false}'));
+ expect(descriptor.value, equals("a"));
+ expect(descriptor.writable, isTrue);
+ expect(descriptor.enumerable, isTrue);
+ expect(descriptor.configurable, isTrue);
+
+ descriptor = getOwnPropertyDescriptor(list, "length");
+ expect(descriptor.value, equals(2));
+ expect(descriptor.writable, isTrue);
+ expect(descriptor.enumerable, isFalse);
+ expect(descriptor.configurable, isFalse);
});
test("concat js arrays", () {
@@ -680,8 +688,8 @@ main() {
expect(listView.length, equals(2));
expect(checkIsArray(listView), isFalse);
expect(checkIsArray(listView.toList()), isTrue);
- expect(getOwnPropertyDescriptorJson(
- listView, "length"), equals("null"));
+ expect(getOwnPropertyDescriptor(
+ listView, "length"), equals(null));
});
});
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698