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

Side by Side Diff: test/codegen/opassign.dart

Issue 1069493002: implement opassign, fix bugs in pre/postfix, introduce a let* helper (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
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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 get index {
6 print('called "index" getter');
7 return 0;
8 }
9
10 final _foo = new Foo();
11 get foo {
12 print('called "foo" getter');
13 return _foo;
14 }
15
16 class Foo { int x = 100; }
17
18 main() {
19 var f = { 0: 40 };
20 print('should only call "index" 2 times:');
21 ++f[index];
22 forcePostfix(f[index]++);
23
24 print('should only call "foo" 2 times:');
25 ++foo.x;
26 forcePostfix(foo.x++);
27
28 print('op assign test, should only call "index" twice:');
29 f[index] += f[index];
30 }
31
32 // Postfix generates as prefix if the value isn't used. This method prevents it.
33 forcePostfix(x) {}
OLDNEW
« test/codegen/expect/cascade.js ('K') | « test/codegen/expect/opassign.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698