fix(library): indexedDB shouldn't stumble over `null` in Firefox (#35308)
This commit is contained in:
parent
b83e0af11a
commit
53ed2f601b
|
@ -36,8 +36,8 @@ export async function collect(serializers: ReturnType<typeof source>, isFirefox:
|
||||||
function isPlainObject(v: any) {
|
function isPlainObject(v: any) {
|
||||||
const ctor = v?.constructor;
|
const ctor = v?.constructor;
|
||||||
if (isFirefox) {
|
if (isFirefox) {
|
||||||
const constructorImpl = ctor?.toString();
|
const constructorImpl = ctor?.toString() as string | undefined;
|
||||||
if (constructorImpl.startsWith('function Object() {') && constructorImpl.includes('[native code]'))
|
if (constructorImpl?.startsWith('function Object() {') && constructorImpl?.includes('[native code]'))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ it('should round-trip through the file', async ({ contextFactory }, testInfo) =>
|
||||||
const transaction = openRequest.result.transaction(['store', 'store2'], 'readwrite');
|
const transaction = openRequest.result.transaction(['store', 'store2'], 'readwrite');
|
||||||
transaction
|
transaction
|
||||||
.objectStore('store')
|
.objectStore('store')
|
||||||
.put({ name: 'foo', date: new Date(0) });
|
.put({ name: 'foo', date: new Date(0), null: null });
|
||||||
transaction
|
transaction
|
||||||
.objectStore('store2')
|
.objectStore('store2')
|
||||||
.put('bar', 'foo');
|
.put('bar', 'foo');
|
||||||
|
@ -138,7 +138,7 @@ it('should round-trip through the file', async ({ contextFactory }, testInfo) =>
|
||||||
openRequest.addEventListener('error', () => reject(openRequest.error));
|
openRequest.addEventListener('error', () => reject(openRequest.error));
|
||||||
}));
|
}));
|
||||||
expect(idbValues).toEqual([
|
expect(idbValues).toEqual([
|
||||||
{ name: 'foo', date: new Date(0) },
|
{ name: 'foo', date: new Date(0), null: null },
|
||||||
'bar'
|
'bar'
|
||||||
]);
|
]);
|
||||||
await context2.close();
|
await context2.close();
|
||||||
|
|
Loading…
Reference in New Issue