| 1 |
// This Source Code Form is subject to the terms of the Mozilla Public |
| 2 |
// License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 |
// file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 |
|
| 5 |
js> load('testsrc/doctests/util.js') |
| 6 |
|
| 7 |
js> var bom = String.fromCharCode(0xFEFF); |
| 8 |
js> eval(bom); |
| 9 |
js> var _ = eval("(function(){return"+bom+"1;})"); |
| 10 |
js> expectError(function() { |
| 11 |
> eval("i"+bom+"f (false);"); |
| 12 |
> }, SyntaxError); |
| 13 |
|
| 14 |
js> parseInt(bom+"1") |
| 15 |
1 |
| 16 |
js> parseFloat(bom+"1.5"); |
| 17 |
1.5 |
| 18 |
js> (bom+"abc"+bom).trim().length |
| 19 |
3 |
| 20 |
js> /\s/.test(bom) |
| 21 |
true |
| 22 |
js> (bom+"1"+bom) * 1 |
| 23 |
1 |