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) {
|
||||
const ctor = v?.constructor;
|
||||
if (isFirefox) {
|
||||
const constructorImpl = ctor?.toString();
|
||||
if (constructorImpl.startsWith('function Object() {') && constructorImpl.includes('[native code]'))
|
||||
const constructorImpl = ctor?.toString() as string | undefined;
|
||||
if (constructorImpl?.startsWith('function Object() {') && constructorImpl?.includes('[native code]'))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ it('should round-trip through the file', async ({ contextFactory }, testInfo) =>
|
|||
const transaction = openRequest.result.transaction(['store', 'store2'], 'readwrite');
|
||||
transaction
|
||||
.objectStore('store')
|
||||
.put({ name: 'foo', date: new Date(0) });
|
||||
.put({ name: 'foo', date: new Date(0), null: null });
|
||||
transaction
|
||||
.objectStore('store2')
|
||||
.put('bar', 'foo');
|
||||
|
@ -138,7 +138,7 @@ it('should round-trip through the file', async ({ contextFactory }, testInfo) =>
|
|||
openRequest.addEventListener('error', () => reject(openRequest.error));
|
||||
}));
|
||||
expect(idbValues).toEqual([
|
||||
{ name: 'foo', date: new Date(0) },
|
||||
{ name: 'foo', date: new Date(0), null: null },
|
||||
'bar'
|
||||
]);
|
||||
await context2.close();
|
||||
|
|
Loading…
Reference in New Issue