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

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

Issue 1965213003: simplify constructors, fixes #564 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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
« no previous file with comments | « test/codegen/expect/notnull.js ('k') | test/codegen/expect/sunflower/sunflower.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 dart_library.library('opassign', null, /* Imports */[ 1 dart_library.library('opassign', null, /* Imports */[
2 'dart_sdk' 2 'dart_sdk'
3 ], function(exports, dart_sdk) { 3 ], function(exports, dart_sdk) {
4 'use strict'; 4 'use strict';
5 const core = dart_sdk.core; 5 const core = dart_sdk.core;
6 const dart = dart_sdk.dart; 6 const dart = dart_sdk.dart;
7 const dartx = dart_sdk.dartx; 7 const dartx = dart_sdk.dartx;
8 const opassign = Object.create(null); 8 const opassign = Object.create(null);
9 dart.copyProperties(opassign, { 9 dart.copyProperties(opassign, {
10 get index() { 10 get index() {
11 core.print('called "index" getter'); 11 core.print('called "index" getter');
12 return 0; 12 return 0;
13 } 13 }
14 }); 14 });
15 dart.defineLazy(opassign, { 15 dart.defineLazy(opassign, {
16 get _foo() { 16 get _foo() {
17 return new opassign.Foo(); 17 return new opassign.Foo();
18 } 18 }
19 }); 19 });
20 dart.copyProperties(opassign, { 20 dart.copyProperties(opassign, {
21 get foo() { 21 get foo() {
22 core.print('called "foo" getter'); 22 core.print('called "foo" getter');
23 return opassign._foo; 23 return opassign._foo;
24 } 24 }
25 }); 25 });
26 opassign.Foo = class Foo extends core.Object { 26 opassign.Foo = class Foo extends core.Object {
27 Foo() { 27 new() {
28 this.x = 100; 28 this.x = 100;
29 } 29 }
30 }; 30 };
31 opassign.main = function() { 31 opassign.main = function() {
32 let f = dart.map([0, 40]); 32 let f = dart.map([0, 40]);
33 core.print('should only call "index" 2 times:'); 33 core.print('should only call "index" 2 times:');
34 let i = dart.as(opassign.index, core.int); 34 let i = dart.as(opassign.index, core.int);
35 f[dartx.set](i, dart.notNull(f[dartx.get](i)) + 1); 35 f[dartx.set](i, dart.notNull(f[dartx.get](i)) + 1);
36 opassign.forcePostfix((() => { 36 opassign.forcePostfix((() => {
37 let i = dart.as(opassign.index, core.int), x = f[dartx.get](i); 37 let i = dart.as(opassign.index, core.int), x = f[dartx.get](i);
(...skipping 12 matching lines...) Expand all
50 let i$ = dart.as(opassign.index, core.int); 50 let i$ = dart.as(opassign.index, core.int);
51 f[dartx.set](i$, dart.notNull(f[dartx.get](i$)) + dart.notNull(f[dartx.get]( opassign.index))); 51 f[dartx.set](i$, dart.notNull(f[dartx.get](i$)) + dart.notNull(f[dartx.get]( opassign.index)));
52 }; 52 };
53 dart.fn(opassign.main); 53 dart.fn(opassign.main);
54 opassign.forcePostfix = function(x) { 54 opassign.forcePostfix = function(x) {
55 }; 55 };
56 dart.fn(opassign.forcePostfix); 56 dart.fn(opassign.forcePostfix);
57 // Exports: 57 // Exports:
58 exports.opassign = opassign; 58 exports.opassign = opassign;
59 }); 59 });
OLDNEW
« no previous file with comments | « test/codegen/expect/notnull.js ('k') | test/codegen/expect/sunflower/sunflower.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698