Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013, 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 import "package:expect/expect.dart"; | |
| 6 | |
| 7 class A { | |
| 8 _uniqueSelector() { } | |
| 9 final uniqueField = 10; | |
| 10 } | |
| 11 | |
| 12 foofoo(obj) { | |
| 13 var res = 0; | |
|
Vyacheslav Egorov (Google)
2016/11/16 12:55:06
incorrect indentation
Florian Schneider
2016/11/16 17:55:18
Done.
| |
| 14 for (var i = 0; i < 2; i++) { | |
| 15 obj._uniqueSelector(); | |
| 16 res += obj.uniqueField; // This load must not be hoisted out of the loop. | |
| 17 } | |
| 18 return res; | |
| 19 } | |
| 20 | |
| 21 var foofoo_ = foofoo; | |
| 22 | |
| 23 main () { | |
| 24 Expect.equals(20, foofoo_(new A())); | |
| 25 Expect.throws(() => foofoo_(0)); | |
| 26 } | |
| OLD | NEW |