Skip to content

Commit c6f5edc

Browse files
committed
refactor
1 parent bb2220e commit c6f5edc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/playwright-core/src/server/storageScript.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@ export async function collect(serializers: ReturnType<typeof source>, isFirefox:
3535

3636
function isPlainObject(v: any) {
3737
const ctor = v?.constructor;
38-
if (ctor === Object)
39-
return true;
40-
41-
// firefox bug. the above check doesn't work in the utility world.
4238
if (isFirefox) {
4339
const constructorImpl = ctor?.toString();
44-
if (constructorImpl.startsWith('function Object() {') && constructorImpl.includes(' [native code]'))
40+
if (constructorImpl.startsWith('function Object() {') && constructorImpl.includes('[native code]'))
4541
return true;
4642
}
4743

48-
return false;
44+
return ctor === Object;
4945
}
5046

5147
function trySerialize(value: any): { trivial?: any, encoded?: any } {

0 commit comments

Comments
 (0)