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

Side by Side Diff: tests/compiler/dart2js_native/super_property_test.dart

Issue 2984403002: dart2js_native tests: Migrate 'native STRING' to JS-calls (Closed)
Patch Set: the rest of the files Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js_native/super_call_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import "native_testing.dart"; 5 import "native_testing.dart";
6 6
7 // Tests super setter where the HInvokeSuper is using interceptor aka 7 // Tests super setter where the HInvokeSuper is using interceptor aka
8 // explicit-receiver calling convention. 8 // explicit-receiver calling convention.
9 9
10 @Native("A") 10 @Native("A")
(...skipping 22 matching lines...) Expand all
33 set foo(value) { 33 set foo(value) {
34 super.foo = value; 34 super.foo = value;
35 } 35 }
36 36
37 get foo => super.foo; 37 get foo => super.foo;
38 } 38 }
39 39
40 makeA() native; 40 makeA() native;
41 makeB() native; 41 makeB() native;
42 42
43 void setup() native """ 43 void setup() {
44 // This code is all inside 'setup' and so not accessible from the global scope. 44 JS('', r"""
45 function A(){} 45 (function(){
46 function B(){} 46 // This code is inside 'setup' and so not accessible from the global scope.
47 makeA = function(){return new A}; 47 function A(){}
48 makeB = function(){return new B}; 48 function B(){}
49 self.nativeConstructor(A); 49 makeA = function(){return new A()};
50 self.nativeConstructor(B); 50 makeB = function(){return new B()};
51 """; 51 self.nativeConstructor(A);
52 self.nativeConstructor(B);
53 })()""");
54 }
52 55
53 testThing(a) { 56 testThing(a) {
54 a.foo = 123; 57 a.foo = 123;
55 Expect.equals(123, a.foo); 58 Expect.equals(123, a.foo);
56 Expect.equals(123, a.get_foo()); 59 Expect.equals(123, a.get_foo());
57 60
58 a.bar = 234; 61 a.bar = 234;
59 Expect.equals(234, a.foo); 62 Expect.equals(234, a.foo);
60 Expect.equals(234, a.get_foo()); 63 Expect.equals(234, a.get_foo());
61 } 64 }
62 65
63 main() { 66 main() {
64 nativeTesting(); 67 nativeTesting();
65 setup(); 68 setup();
66 var things = [makeA(), makeB(), new C(), new D()]; 69 var things = [makeA(), makeB(), new C(), new D()];
67 var test = testThing; 70 var test = testThing;
68 test(things[0]); 71 test(things[0]);
69 test(things[1]); 72 test(things[1]);
70 test(things[2]); 73 test(things[2]);
71 test(things[3]); 74 test(things[3]);
72 } 75 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/super_call_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698