(functionNameRoot, steps)
| 71 | ]; |
| 72 | |
| 73 | function testDateFunctionWithValueNoRecoverNaN(functionNameRoot, steps) |
| 74 | { |
| 75 | var date = new Date(); |
| 76 | var setValue = date["get" + functionNameRoot](); |
| 77 | date.setMilliseconds(Number.NaN); |
| 78 | var params = [ |
| 79 | "", |
| 80 | ", 0", |
| 81 | ", 0, 0", |
| 82 | ", 0, 0, 0" |
| 83 | ]; |
| 84 | var setResult = (1 == steps) ? date["set" + functionNameRoot](setValue) |
| 85 | : ((2 == steps) ? date["set" + functionNameRoot](setValue, 0) |
| 86 | : ((3 == steps) ? date["set" + functionNameRoot](setValue, 0, 0) |
| 87 | : date["set" + functionNameRoot](setValue, 0, 0, 0))); |
| 88 | if (!isNaN(setResult)) { |
| 89 | testFailed("date(NaN).set" + functionNameRoot + "(" + setValue + params[steps - 1] |
| 90 | + ") was " + setResult + " instead of NaN"); |
| 91 | return false; |
| 92 | } |
| 93 | var getResult = date["get" + functionNameRoot](); |
| 94 | if (!isNaN(getResult)) { |
| 95 | testFailed("date.get" + functionNameRoot + "() was " + getResult + " instead of NaN"); |
| 96 | return false; |
| 97 | } |
| 98 | testPassed ("no recovering from NaN date using date.set" + functionNameRoot |
| 99 | + "(arg0" + params[steps - 1] + ")"); |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | function testDateFunctionWithValueRecoverTime(functionNameRoot) |
| 104 | { |
no test coverage detected