MCPcopy Create free account
hub / github.com/nodejs/node / testDateFunctionWithValueRecoverTime

Function testDateFunctionWithValueRecoverTime

deps/v8/test/webkit/date-set-to-nan.js:103–120  ·  view source on GitHub ↗
(functionNameRoot)

Source from the content-addressed store, hash-verified

101}
102
103function testDateFunctionWithValueRecoverTime(functionNameRoot)
104{
105 var date = new Date();
106 var setValue = date["get" + functionNameRoot]();
107 date.setMilliseconds(Number.NaN);
108 var setResult = date["set" + functionNameRoot](setValue);
109 if (setValue != setResult) {
110 testFailed("date(NaN).set" + functionNameRoot + "(" + setValue + ") was " + setResult + " instead of " + setValue);
111 return false;
112 }
113 var getResult = date["get" + functionNameRoot]();
114 if (getResult != setValue) {
115 testFailed("date.get" + functionNameRoot + "() was " + getResult + " instead of " + setValue);
116 return false;
117 }
118 testPassed ("recover from NaN date using date.set" + functionNameRoot + "()");
119 return true;
120}
121
122function testDateFunctionWithValueRecoverFullYear(functionNameRoot)
123{

Callers 1

testDateFunctionFunction · 0.85

Calls 2

testFailedFunction · 0.85
testPassedFunction · 0.85

Tested by

no test coverage detected