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

Side by Side Diff: tests/language/class_codegen_test.dart

Issue 10344021: Create the JavaScript constructor dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test. Created 8 years, 7 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 class A {
6 A() : x = 3;
7 foo() => x;
8 var x;
9 }
10
11 class B extends A {
12 bar() => 499;
13 }
14
15 class C extends A {
16 bar() => 42;
17 }
18
19 main() {
20 // We don't instantiate A, but the codegen still needs to emit (parts of) it
21 // for inheritence purposes.
22 var b = new B();
23 var c = new C();
24 Expect.equals(3, b.foo());
25 Expect.equals(3, c.foo());
26 Expect.equals(499, b.bar());
27 Expect.equals(42, c.bar());
28 }
OLDNEW
« lib/compiler/implementation/emitter.dart ('K') | « lib/compiler/implementation/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698