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

Side by Side Diff: tests/compiler/dart2js_native/native_no_such_method_exception_frog_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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 @Native("A") 7 @Native("A")
8 class A { 8 class A {
9 bar() => 42; 9 bar() => 42;
10 } 10 }
11 11
12 @Native("B") 12 @Native("B")
13 class B { 13 class B {
14 foo() => 42; 14 foo() => 42;
15 } 15 }
16 16
17 makeA() native; 17 makeA() native;
18 18
19 setup() native """ 19 setup() {
20 JS('', r"""
21 (function(){
20 function A() {} 22 function A() {}
21 makeA = function() { return new A; } 23 makeA = function() { return new A(); };
22 self.nativeConstructor(A); 24 self.nativeConstructor(A);
23 """; 25 })()""");
26 }
24 27
25 main() { 28 main() {
26 nativeTesting(); 29 nativeTesting();
27 setup(); 30 setup();
28 var a = makeA(); 31 var a = makeA();
29 a.bar(); 32 a.bar();
30 var exception; 33 var exception;
31 try { 34 try {
32 a.foo(); 35 a.foo();
33 } on NoSuchMethodError catch (e) { 36 } on NoSuchMethodError catch (e) {
34 exception = e; 37 exception = e;
35 } 38 }
36 Expect.isNotNull(exception); 39 Expect.isNotNull(exception);
37 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698