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

Side by Side Diff: frog/tests/native/src/NativeNoSuchMethodException2FrogTest.dart

Issue 9921010: Address review comments from: https://chromiumcodereview.appspot.com/9750003. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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) 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 class A native "*A" { 5 class A native "*A" {
6 bar() => 42;
7 } 6 }
8 7
9 class B native "*B" { 8 class B extends A native "*B" {
10 foo() => 42; 9 foo() native;
11 } 10 }
12 11
13 makeA() native; 12 makeA() native;
13 makeB() native;
14 14
15 setup() native """ 15 setup() native """
16 function inherits(child, parent) {
17 if (child.prototype.__proto__) {
18 child.prototype.__proto__ = parent.prototype;
19 } else {
20 function tmp() {};
21 tmp.prototype = parent.prototype;
22 child.prototype = new tmp();
23 child.prototype.constructor = child;
24 }
25 }
16 function A() {} 26 function A() {}
27 function B() {}
28 inherits(B, A);
17 makeA = function() { return new A; } 29 makeA = function() { return new A; }
30 makeB = function() { return new B; }
31 B.prototype.foo = function() { return 42; }
18 """; 32 """;
19 33
20 main() { 34 main() {
21 setup(); 35 setup();
22 var a = makeA(); 36 var a = makeA();
23 a.bar();
24 var exception; 37 var exception;
25 try { 38 try {
26 a.foo(); 39 a.foo();
27 } catch (NoSuchMethodException e) { 40 } catch (NoSuchMethodException e) {
28 exception = e; 41 exception = e;
29 } 42 }
30 Expect.isNotNull(exception); 43 Expect.isNotNull(exception);
44
45 var b = makeB();
46 Expect.equals(42, b.foo());
31 } 47 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/js_helper.dart » ('j') | lib/compiler/implementation/lib/native_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698