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

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

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "dart:_js_helper"; 5 import "dart:_js_helper";
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 // Test to see if resolving a hidden native class's method interferes with 8 // Test to see if resolving a hidden native class's method interferes with
9 // subsequent resolving the subclass's method. This might happen if the 9 // subsequent resolving the subclass's method. This might happen if the
10 // superclass caches the method in the prototype, so shadowing the dispatcher 10 // superclass caches the method in the prototype, so shadowing the dispatcher
(...skipping 14 matching lines...) Expand all
25 class C extends B { 25 class C extends B {
26 foo() => 'C.foo; super.foo = ${super.foo()}'; 26 foo() => 'C.foo; super.foo = ${super.foo()}';
27 bar() => 'C.bar'; 27 bar() => 'C.bar';
28 } 28 }
29 29
30 @Native("D") 30 @Native("D")
31 class D extends C { 31 class D extends C {
32 bar() => 'D.bar'; 32 bar() => 'D.bar';
33 } 33 }
34 34
35 makeA() native; 35 makeA() native ;
36 makeB() native; 36 makeB() native ;
37 makeC() native; 37 makeC() native ;
38 makeD() native; 38 makeD() native ;
39 39
40 void setup() native """ 40 void setup() native """
41 // This code is all inside 'setup' and so not accesible from the global scope. 41 // This code is all inside 'setup' and so not accesible from the global scope.
42 function inherits(child, parent) { 42 function inherits(child, parent) {
43 if (child.prototype.__proto__) { 43 if (child.prototype.__proto__) {
44 child.prototype.__proto__ = parent.prototype; 44 child.prototype.__proto__ = parent.prototype;
45 } else { 45 } else {
46 function tmp() {}; 46 function tmp() {};
47 tmp.prototype = parent.prototype; 47 tmp.prototype = parent.prototype;
48 child.prototype = new tmp(); 48 child.prototype = new tmp();
49 child.prototype.constructor = child; 49 child.prototype.constructor = child;
50 } 50 }
51 } 51 }
52 52
53 function A(){} 53 function A(){}
54 function B(){} 54 function B(){}
55 inherits(B, A); 55 inherits(B, A);
56 function C(){} 56 function C(){}
57 inherits(C, B); 57 inherits(C, B);
58 function D(){} 58 function D(){}
59 inherits(D, C); 59 inherits(D, C);
60 60
61 makeA = function(){return new A}; 61 makeA = function(){return new A};
62 makeB = function(){return new B}; 62 makeB = function(){return new B};
63 makeC = function(){return new C}; 63 makeC = function(){return new C};
64 makeD = function(){return new D}; 64 makeD = function(){return new D};
65 """; 65 """;
66 66
67
68 main() { 67 main() {
69 setup(); 68 setup();
70 69
71 var a = makeA(); 70 var a = makeA();
72 var b = makeB(); 71 var b = makeB();
73 var c = makeC(); 72 var c = makeC();
74 var d = makeD(); 73 var d = makeD();
75 74
76 Expect.equals('A.foo A.bar', a.foo()); 75 Expect.equals('A.foo A.bar', a.foo());
77 Expect.equals('A.foo B.bar', b.foo()); 76 Expect.equals('A.foo B.bar', b.foo());
78 Expect.equals('C.foo; super.foo = A.foo C.bar', c.foo()); 77 Expect.equals('C.foo; super.foo = A.foo C.bar', c.foo());
79 Expect.equals('C.foo; super.foo = A.foo D.bar', d.foo()); 78 Expect.equals('C.foo; super.foo = A.foo D.bar', d.foo());
80 } 79 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/subclassing_type_test.dart ('k') | tests/compiler/dart2js_native/super_property_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698