| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-306591.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 306591; |
| 9 |
var summary = 'String static methods'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
|
| 13 |
printBugNumber(BUGNUMBER); |
| 14 |
printStatus (summary); |
| 15 |
printStatus ('See https://bugzilla.mozilla.org/show_bug.cgi?id=304828'); |
| 16 |
|
| 17 |
expect = ['a', 'b', 'c'].toString(); |
| 18 |
actual = String.split(new String('abc'), '').toString(); |
| 19 |
reportCompare(expect, actual, summary + |
| 20 |
" String.split(new String('abc'), '')"); |
| 21 |
|
| 22 |
expect = '2'; |
| 23 |
actual = String.substring(new Number(123), 1, 2); |
| 24 |
reportCompare(expect, actual, summary + |
| 25 |
" String.substring(new Number(123), 1, 2)"); |
| 26 |
|
| 27 |
expect = 'TRUE'; |
| 28 |
actual = String.toUpperCase(new Boolean(true)); |
| 29 |
reportCompare(expect, actual, summary + |
| 30 |
" String.toUpperCase(new Boolean(true))"); |
| 31 |
|
| 32 |
|
| 33 |
expect = (typeof window == 'undefined') ? 9 : -1; |
| 34 |
actual = String.indexOf(null, 'l'); |
| 35 |
reportCompare(expect, actual, summary + |
| 36 |
" String.indexOf(null, 'l')"); |
| 37 |
|
| 38 |
expect = 2; |
| 39 |
actual = String.indexOf(String(null), 'l'); |
| 40 |
reportCompare(expect, actual, summary + |
| 41 |
" String.indexOf(String(null), 'l')"); |
| 42 |
|
| 43 |
expect = ['a', 'b', 'c'].toString(); |
| 44 |
actual = String.split('abc', '').toString(); |
| 45 |
reportCompare(expect, actual, summary + |
| 46 |
" String.split('abc', '')"); |
| 47 |
|
| 48 |
expect = '2'; |
| 49 |
actual = String.substring(123, 1, 2); |
| 50 |
reportCompare(expect, actual, summary + |
| 51 |
" String.substring(123, 1, 2)"); |
| 52 |
|
| 53 |
expect = 'TRUE'; |
| 54 |
actual = String.toUpperCase(true); |
| 55 |
reportCompare(expect, actual, summary + |
| 56 |
" String.toUpperCase(true)"); |
| 57 |
|
| 58 |
|
| 59 |
expect = (typeof window == 'undefined') ? -1 : 11; |
| 60 |
actual = String.indexOf(undefined, 'd'); |
| 61 |
reportCompare(expect, actual, summary + |
| 62 |
" String.indexOf(undefined, 'd')"); |
| 63 |
|
| 64 |
expect = 2; |
| 65 |
actual = String.indexOf(String(undefined), 'd'); |
| 66 |
reportCompare(expect, actual, summary + |
| 67 |
" String.indexOf(String(undefined), 'd')"); |