Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
| 7 | 7 |
| 8 const String TEST_ONE = r""" | 8 const String TEST_ONE = r""" |
| 9 foo(a) { | 9 foo(a) { |
| 10 var myVariableName = a.toString(); | 10 var myVariableName = a.toString(); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 Expect.isTrue(generated.contains(new RegExp(r'[$A-Z]+\.toString\$0\(a\)'))); | 30 Expect.isTrue(generated.contains(new RegExp(r'[$A-Z]+\.toString\$0\(a\)'))); |
| 31 Expect.isTrue(generated.contains('myVariableName')); | 31 Expect.isTrue(generated.contains('myVariableName')); |
| 32 | 32 |
| 33 // Check that an intercepted getter that does not need to be | 33 // Check that an intercepted getter that does not need to be |
| 34 // intercepted, is turned into a regular getter call or field | 34 // intercepted, is turned into a regular getter call or field |
| 35 // access. | 35 // access. |
| 36 generated = compile(TEST_TWO, entry: 'foo'); | 36 generated = compile(TEST_TWO, entry: 'foo'); |
| 37 Expect.isFalse(generated.contains(r'a.get$length()')); | 37 Expect.isFalse(generated.contains(r'a.get$length()')); |
| 38 Expect.isTrue(generated.contains(new RegExp(r'[$A-Z]+\.A\$\(\)\.length'))); | 38 Expect.isTrue(generated.contains(new RegExp(r'[$A-Z]+\.A\$\(\)\.length'))); |
| 39 Expect.isTrue( | 39 Expect.isTrue( |
| 40 generated.contains(new RegExp(r'[$A-Z]+\.get\$length\$a\(a\)'))); | 40 generated.contains(new RegExp(r'[$A-Z]+\.get\$length\$as\(a\)'))); |
|
floitsch
2013/10/25 11:57:02
I have to trust on this one.
If you are not sure,
ngeoffray
2013/10/25 11:58:03
Because we instantiate the string class now, the i
floitsch
2013/10/25 12:20:39
ok. makes sense.
| |
| 41 } | 41 } |
| OLD | NEW |