| 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 | 6 |
| 7 // Characters with Whitespace property (Unicode 6.3). | 7 // Characters with Whitespace property (Unicode 6.3). |
| 8 // 0009..000D ; White_Space # Cc <control-0009>..<control-000D> | 8 // 0009..000D ; White_Space # Cc <control-0009>..<control-000D> |
| 9 // 0020 ; White_Space # Zs SPACE | 9 // 0020 ; White_Space # Zs SPACE |
| 10 // 0085 ; White_Space # Cc <control-0085> | 10 // 0085 ; White_Space # Cc <control-0085> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 for (int i = 0, j = 0; i <= 0x10000; i++) { | 85 for (int i = 0, j = 0; i <= 0x10000; i++) { |
| 86 if (j < WHITESPACE.length && i == WHITESPACE[j]) { | 86 if (j < WHITESPACE.length && i == WHITESPACE[j]) { |
| 87 j++; | 87 j++; |
| 88 continue; | 88 continue; |
| 89 } | 89 } |
| 90 // U+200b is currently being treated as whitespace by some JS engines. | 90 // U+200b is currently being treated as whitespace by some JS engines. |
| 91 // Should be fixed in tip-of-tree V8 per 2014-02-10. | 91 // Should be fixed in tip-of-tree V8 per 2014-02-10. |
| 92 // This line makes string_trimlr_test/none fail but /01 succeede where | 92 // This line makes string_trimlr_test/none fail but /01 succeede where |
| 93 // this bug is in the JS. Both succeede on the VM and where the bug is | 93 // this bug is in the JS. Both succeede on the VM and where the bug is |
| 94 // not. Remove this line and comment if all JS engines fix it. | 94 // not. Remove this line and comment if all JS engines fix it. |
| 95 if (i == 0x200b) continue; /// 01: ok | 95 if (i == 0x200b) continue; // /// 01: ok |
| 96 | 96 |
| 97 var s = new String.fromCharCode(i); | 97 var s = new String.fromCharCode(i); |
| 98 Expect.identical(s, s.trimLeft()); | 98 Expect.identical(s, s.trimLeft()); |
| 99 Expect.identical(s, s.trimRight()); | 99 Expect.identical(s, s.trimRight()); |
| 100 } | 100 } |
| 101 } | 101 } |
| OLD | NEW |