Index: tests/compiler/dart2js_native/native_class_fields_3_test.dart |
diff --git a/tests/compiler/dart2js_native/native_class_fields_3_test.dart b/tests/compiler/dart2js_native/native_class_fields_3_test.dart |
index 5576638eeab9f7b8edbed271e11b22e1d7405674..ce6c28db06c786642a5282e2685c0e4a934444e6 100644 |
--- a/tests/compiler/dart2js_native/native_class_fields_3_test.dart |
+++ b/tests/compiler/dart2js_native/native_class_fields_3_test.dart |
@@ -2,7 +2,8 @@ |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
-import "native_testing.dart"; |
+import "dart:_js_helper"; |
+import "package:expect/expect.dart"; |
// Verify that we can have fields with names that start with g and s even |
// though those names are reserved for getters and setters in minified mode. |
@@ -44,7 +45,7 @@ var descriptor = { |
function A(){ |
var a = Object.create( |
- { constructor: A }, |
+ { constructor: { name: 'A'}}, |
{ bar: descriptor, |
g: descriptor, |
s: descriptor, |
@@ -58,46 +59,30 @@ function A(){ |
} |
makeA = function() { return new A; }; |
-self.nativeConstructor(A); |
"""; |
A makeA() native ; |
class B {} |
+int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1)); |
+ |
main() { |
- nativeTesting(); |
setup(); |
- confuse(new B()); |
- var a = makeA(); |
- |
- Expect.equals(42, confuse(a).bar); |
- Expect.equals(42, confuse(a).g); |
- Expect.equals(42, confuse(a).s); |
- Expect.equals(42, confuse(a).end); |
- Expect.equals(42, confuse(a).gend); |
- Expect.equals(42, confuse(a).send); |
- Expect.equals(271, confuse(a).bar = 271); |
- Expect.equals(271, confuse(a).g = 271); |
- Expect.equals(271, confuse(a).s = 271); |
- Expect.equals(271, confuse(a).end = 271); |
- Expect.equals(271, confuse(a).gend = 271); |
- Expect.equals(271, confuse(a).send = 271); |
- Expect.equals(6, confuse(a).gettersCalled); |
- Expect.equals(6, confuse(a).settersCalled); |
- |
- Expect.equals(42, a.bar); |
- Expect.equals(42, a.g); |
- Expect.equals(42, a.s); |
- Expect.equals(42, a.end); |
- Expect.equals(42, a.gend); |
- Expect.equals(42, a.send); |
- Expect.equals(271, a.bar = 271); |
- Expect.equals(271, a.g = 271); |
- Expect.equals(271, a.s = 271); |
- Expect.equals(271, a.end = 271); |
- Expect.equals(271, a.gend = 271); |
- Expect.equals(271, a.send = 271); |
- Expect.equals(12, a.gettersCalled); |
- Expect.equals(12, a.settersCalled); |
+ var both = [makeA(), new B()]; |
+ var foo = both[inscrutable(0)]; |
+ Expect.equals(42, foo.bar); |
+ Expect.equals(42, foo.g); |
+ Expect.equals(42, foo.s); |
+ Expect.equals(42, foo.end); |
+ Expect.equals(42, foo.gend); |
+ Expect.equals(42, foo.send); |
+ Expect.equals(271, foo.bar = 271); |
+ Expect.equals(271, foo.g = 271); |
+ Expect.equals(271, foo.s = 271); |
+ Expect.equals(271, foo.end = 271); |
+ Expect.equals(271, foo.gend = 271); |
+ Expect.equals(271, foo.send = 271); |
+ Expect.equals(6, foo.gettersCalled); |
+ Expect.equals(6, foo.settersCalled); |
} |