| 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 'compiler_helper.dart'; |
| 6 |
| 7 const String TEST_ONE = r""" |
| 8 foo(a) { |
| 9 // Make sure there is a bailout version. |
| 10 foo(a); |
| 11 // This will make a one shot interceptor that will be optimized in |
| 12 // the non-bailout version because we know a is a number. |
| 13 return (a + 42).toString; |
| 14 } |
| 15 """; |
| 16 |
| 17 main() { |
| 18 var generated = compile(TEST_ONE, entry: 'foo'); |
| 19 // Check that the one shot interceptor got converted to a direct |
| 20 // call to the interceptor object. |
| 21 Expect.isTrue(generated.contains('CONSTANT.get\$toString(a + 42);')); |
| 22 } |
| OLD | NEW |