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

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

Issue 2990083002: dart2js_native tests: Migrate 'native STRING' to JS-calls - part 2/2 (Closed)
Patch Set: remove defunct comments 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
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 import 'dart:_js_helper' show setNativeSubclassDispatchRecord; 6 import 'dart:_js_helper' show setNativeSubclassDispatchRecord;
7 import 'dart:_interceptors' show Interceptor, findInterceptorForType; 7 import 'dart:_interceptors' show Interceptor, findInterceptorForType;
8 8
9 // Test calling convention of methods introduced on subclasses of native 9 // Test calling convention of methods introduced on subclasses of native
10 // class of mixin. 10 // class of mixin.
(...skipping 16 matching lines...) Expand all
27 // have interceptor calling convention. 27 // have interceptor calling convention.
28 oof() => 'B'; 28 oof() => 'B';
29 // [miz] is introduced only on the mixin-application A+M. 29 // [miz] is introduced only on the mixin-application A+M.
30 } 30 }
31 31
32 B makeB() native; 32 B makeB() native;
33 33
34 @Creates('=Object') 34 @Creates('=Object')
35 getBPrototype() native; 35 getBPrototype() native;
36 36
37 void setup() native r""" 37 void setup() {
38 function B() {} 38 JS('', r"""
39 makeB = function(){return new B;}; 39 (function(){
40 function B() {}
41 makeB = function(){return new B();};
40 42
41 getBPrototype = function(){return B.prototype;}; 43 getBPrototype = function(){return B.prototype;};
42 """; 44 })()""");
45 }
43 46
44 main() { 47 main() {
45 nativeTesting(); 48 nativeTesting();
46 setup(); 49 setup();
47 50
48 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B)); 51 setNativeSubclassDispatchRecord(getBPrototype(), findInterceptorForType(B));
49 52
50 B b = makeB(); 53 B b = makeB();
51 Expect.equals('1,B,M', b.foo(1)); 54 Expect.equals('1,B,M', b.foo(1));
52 } 55 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_native/subclassing_2_test.dart ('k') | tests/compiler/dart2js_native/subclassing_4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698