| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Test constant folding. | 4 // Test constant folding. |
| 5 | 5 |
| 6 library compiler_helper; | 6 library compiler_helper; |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; |
| 8 import 'dart:uri'; | 9 import 'dart:uri'; |
| 9 export 'dart:uri' show Uri; | 10 export 'dart:uri' show Uri; |
| 10 | 11 |
| 11 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t' | 12 import '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t' |
| 12 as lego; | 13 as lego; |
| 13 export '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; | 14 export '../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t'; |
| 14 | 15 |
| 15 import '../../../sdk/lib/_internal/compiler/implementation/js_backend/js_backend
.dart' | 16 import '../../../sdk/lib/_internal/compiler/implementation/js_backend/js_backend
.dart' |
| 16 as js; | 17 as js; |
| 17 | 18 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 final xRe = new RegExp('\\bx\\b'); | 172 final xRe = new RegExp('\\bx\\b'); |
| 172 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); | 173 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); |
| 173 final spaceRe = new RegExp('\\s+'); | 174 final spaceRe = new RegExp('\\s+'); |
| 174 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); | 175 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); |
| 175 if (shouldMatch) { | 176 if (shouldMatch) { |
| 176 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); | 177 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); |
| 177 } else { | 178 } else { |
| 178 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); | 179 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); |
| 179 } | 180 } |
| 180 } | 181 } |
| OLD | NEW |