| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test that optimized JSArray removeLast() calls generate the same error as | 5 // Test that optimized JSArray removeLast() calls generate the same error as |
| 6 // dyncamically dispatched calls. | 6 // dynamically dispatched calls. |
| 7 | 7 |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 @NoInline() | 10 @NoInline() |
| 11 @AssumeDynamic() | 11 @AssumeDynamic() |
| 12 confuse(x) => x; | 12 confuse(x) => x; |
| 13 | 13 |
| 14 Error getError(action()) { | 14 Error getError(action()) { |
| 15 try { | 15 try { |
| 16 action(); | 16 action(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 30 while (confuse(false)) a.add(1); | 30 while (confuse(false)) a.add(1); |
| 31 // This one should be optimized since [a] is a growable JSArray. | 31 // This one should be optimized since [a] is a growable JSArray. |
| 32 return a.removeLast(); | 32 return a.removeLast(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 var e1 = getError(fault1); | 35 var e1 = getError(fault1); |
| 36 var e2 = getError(fault2); | 36 var e2 = getError(fault2); |
| 37 | 37 |
| 38 Expect.equals('$e1', '$e2'); | 38 Expect.equals('$e1', '$e2'); |
| 39 } | 39 } |
| OLD | NEW |