mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 755508: Do not allow the use of NaN dates as keys. r=sicking
This commit is contained in:
parent
8ab9ce853c
commit
b27b2d8178
@ -168,6 +168,9 @@ Key::EncodeJSValInternal(JSContext* aCx, const jsval aVal,
|
||||
}
|
||||
|
||||
if (JS_ObjectIsDate(aCx, obj)) {
|
||||
if (!js_DateIsValid(aCx, obj)) {
|
||||
return NS_ERROR_DOM_INDEXEDDB_DATA_ERR;
|
||||
}
|
||||
EncodeNumber(js_DateGetMsecSinceEpoch(aCx, obj), eDate + aTypeOffset);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -211,11 +211,14 @@ function testSteps()
|
||||
null,
|
||||
/x/,
|
||||
{},
|
||||
new Date(NaN),
|
||||
new Date("foopy"),
|
||||
[nan],
|
||||
[undefined],
|
||||
[null],
|
||||
[/x/],
|
||||
[{}],
|
||||
[new Date(NaN)],
|
||||
[1, nan],
|
||||
[1, undefined],
|
||||
[1, null],
|
||||
|
Loading…
Reference in New Issue
Block a user