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

Side by Side Diff: tests/compiler/dart2js_foreign/native_class_inheritance4_test.dart

Issue 10920066: issue 4817 fixed. Implemented raw strings with 'r' instead of '@' for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased. Marked raw_string_test as pass for dart2js-ff and dart2dart Created 8 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 | Annotate | Revision Log
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 // Additional Dart code may be 'placed on' hidden native classes. With 5 // Additional Dart code may be 'placed on' hidden native classes. With
6 // inheritance, the superclass method must not be reached by a call on the 6 // inheritance, the superclass method must not be reached by a call on the
7 // subclass. 7 // subclass.
8 8
9 @native("*A") 9 @native("*A")
10 class A { 10 class A {
(...skipping 11 matching lines...) Expand all
22 22
23 int get X => _field2; 23 int get X => _field2;
24 void set X(int x) { _field2 = x; } 24 void set X(int x) { _field2 = x; }
25 25
26 int method(int z) => _field2 + z; 26 int method(int z) => _field2 + z;
27 } 27 }
28 28
29 @native A makeA() { return new A(); } 29 @native A makeA() { return new A(); }
30 @native B makeB() { return new B(); } 30 @native B makeB() { return new B(); }
31 31
32 @native(@""" 32 @native(r"""
33 function inherits(child, parent) { 33 function inherits(child, parent) {
34 if (child.prototype.__proto__) { 34 if (child.prototype.__proto__) {
35 child.prototype.__proto__ = parent.prototype; 35 child.prototype.__proto__ = parent.prototype;
36 } else { 36 } else {
37 function tmp() {}; 37 function tmp() {};
38 tmp.prototype = parent.prototype; 38 tmp.prototype = parent.prototype;
39 child.prototype = new tmp(); 39 child.prototype = new tmp();
40 child.prototype.constructor = child; 40 child.prototype.constructor = child;
41 } 41 }
42 } 42 }
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 140
141 main() { 141 main() {
142 testBasicA_dynamic(); 142 testBasicA_dynamic();
143 testBasicA_typed(); 143 testBasicA_typed();
144 testBasicB_dynamic(); 144 testBasicB_dynamic();
145 testBasicB_typed(); 145 testBasicB_typed();
146 testAB_dynamic(); 146 testAB_dynamic();
147 testAB_typed(); 147 testAB_typed();
148 } 148 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_foreign/foreign_test.dart ('k') | tests/compiler/dart2js_foreign/native_named_constructors2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698