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

Side by Side Diff: test/codegen/expect/fields.js

Issue 1093143004: fixes #52, fields shadowing getters/setters or other fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
« no previous file with comments | « test/codegen/expect/constructors.js ('k') | test/codegen/expect/fields.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 var fields;
2 (function(exports) {
3 'use strict';
4 // Function init: (dynamic) → dynamic
5 function init(x) {
6 core.print(x);
7 return x;
8 }
9 class Base extends core.Object {
10 Base() {
11 dart.initField(Base, this, 'x', init('Base.x'));
12 }
13 }
14 dart.virtualField(Base, 'x');
15 class Mixin1 extends core.Object {
16 Mixin1() {
17 dart.initField(Mixin1, this, 'x', init('Mixin1.x'));
18 }
19 }
20 dart.virtualField(Mixin1, 'x');
21 class Mixin2 extends core.Object {
22 Mixin2() {
23 dart.initField(Mixin2, this, 'x', init('Mixin2.x'));
24 }
25 }
26 dart.virtualField(Mixin2, 'x');
27 class Derived extends dart.mixin(Base, Mixin1, Mixin2) {
28 Derived() {
29 dart.initField(Derived, this, 'x', init('Derived.x'));
30 super.Base();
31 }
32 }
33 class _Base extends core.Object {
34 _Base() {
35 this.x = init('_Base.x');
36 }
37 }
38 let _x = Symbol('_x');
39 class _Mixin1 extends core.Object {
40 _Mixin1() {
41 dart.initField(_Mixin1, this, _x, init('_Mixin1.x'));
42 }
43 }
44 dart.virtualField(_Mixin1, _x);
45 class _Mixin2 extends core.Object {
46 _Mixin2() {
47 dart.initField(_Mixin2, this, _x, init('_Mixin2.x'));
48 }
49 }
50 dart.virtualField(_Mixin2, _x);
51 class _Derived extends dart.mixin(_Base, _Mixin1, _Mixin2) {
52 _Derived() {
53 this[_x] = init('_Derived.x');
54 super._Base();
55 }
56 }
57 // Function main: () → dynamic
58 function main() {
59 core.print('Creating Derived');
60 core.print('Derived.x == ' + dart.notNull(new Derived().x));
61 core.print('Creating _Derived');
62 core.print('_Derived.x == ' + dart.notNull(new _Derived()[_x]));
63 }
64 // Exports:
65 exports.init = init;
66 exports.Base = Base;
67 exports.Mixin1 = Mixin1;
68 exports.Mixin2 = Mixin2;
69 exports.Derived = Derived;
70 exports.main = main;
71 })(fields || (fields = {}));
OLDNEW
« no previous file with comments | « test/codegen/expect/constructors.js ('k') | test/codegen/expect/fields.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698