Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, 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 MAIN = r""" | |
| 8 main() { | |
| 9 foo(x) { | |
| 10 if (x == 0) return x; | |
|
floitsch
2012/10/04 11:35:26
this will be too easy to inline. Maybe change to:
| |
| 11 return x; | |
| 12 } | |
| 13 var x = 1; | |
| 14 if (foo(x) == 0) { | |
| 15 x = 2; | |
| 16 } | |
| 17 print(!(1 < x)); | |
| 18 }"""; | |
| 19 | |
| 20 main() { | |
| 21 // Make sure we don't introduce a new variable. | |
| 22 RegExp regexp = new RegExp("1 >= x"); | |
| 23 compileAndMatch(MAIN, 'main', regexp); | |
| 24 } | |
| OLD | NEW |