mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-27 05:46:28 +03:00
browser(firefox): fixed Array.prototype.toJSON workaround (#7018)
References #7015
This commit is contained in:
parent
3b1bae8a40
commit
9b9091b3fe
@ -1,2 +1,2 @@
|
||||
1262
|
||||
Changed: max@schmitt.mx Tue Jun 8 21:07:04 UTC 2021
|
||||
1263
|
||||
Changed: max@schmitt.mx Thu Jun 10 14:40:52 UTC 2021
|
||||
|
@ -295,10 +295,12 @@ class ExecutionContext {
|
||||
this._id = generateId();
|
||||
this._auxData = auxData;
|
||||
this._jsonStringifyObject = this._debuggee.executeInGlobal(`((stringify, object) => {
|
||||
const oldToJson = Date.prototype.toJSON;
|
||||
const oldToJSON = Date.prototype.toJSON;
|
||||
Date.prototype.toJSON = undefined;
|
||||
const oldArrayToJson = Array.prototype.toJSON;
|
||||
Array.prototype.toJSON = undefined;
|
||||
const oldArrayToJSON = Array.prototype.toJSON;
|
||||
const oldArrayHadToJSON = Array.prototype.hasOwnProperty('toJSON');
|
||||
if (oldArrayHadToJSON)
|
||||
Array.prototype.toJSON = undefined;
|
||||
|
||||
let hasSymbol = false;
|
||||
const result = stringify(object, (key, value) => {
|
||||
@ -307,8 +309,9 @@ class ExecutionContext {
|
||||
return value;
|
||||
});
|
||||
|
||||
Date.prototype.toJSON = oldToJson;
|
||||
Array.prototype.toJSON = oldArrayToJson;
|
||||
Date.prototype.toJSON = oldToJSON;
|
||||
if (oldArrayHadToJSON)
|
||||
Array.prototype.toJSON = oldArrayToJSON;
|
||||
|
||||
return hasSymbol ? undefined : result;
|
||||
}).bind(null, JSON.stringify.bind(JSON))`).return;
|
||||
|
@ -1,2 +1,2 @@
|
||||
1270
|
||||
Changed: max@schmitt.mx Tue Jun 8 20:11:01 UTC 2021
|
||||
1271
|
||||
Changed: max@schmitt.mx Thu Jun 10 14:39:06 UTC 2021
|
||||
|
@ -295,10 +295,12 @@ class ExecutionContext {
|
||||
this._id = generateId();
|
||||
this._auxData = auxData;
|
||||
this._jsonStringifyObject = this._debuggee.executeInGlobal(`((stringify, object) => {
|
||||
const oldToJson = Date.prototype.toJSON;
|
||||
const oldToJSON = Date.prototype.toJSON;
|
||||
Date.prototype.toJSON = undefined;
|
||||
const oldArrayToJson = Array.prototype.toJSON;
|
||||
Array.prototype.toJSON = undefined;
|
||||
const oldArrayToJSON = Array.prototype.toJSON;
|
||||
const oldArrayHadToJSON = Array.prototype.hasOwnProperty('toJSON');
|
||||
if (oldArrayHadToJSON)
|
||||
Array.prototype.toJSON = undefined;
|
||||
|
||||
let hasSymbol = false;
|
||||
const result = stringify(object, (key, value) => {
|
||||
@ -307,8 +309,9 @@ class ExecutionContext {
|
||||
return value;
|
||||
});
|
||||
|
||||
Date.prototype.toJSON = oldToJson;
|
||||
Array.prototype.toJSON = oldArrayToJson;
|
||||
Date.prototype.toJSON = oldToJSON;
|
||||
if (oldArrayHadToJSON)
|
||||
Array.prototype.toJSON = oldArrayToJSON;
|
||||
|
||||
return hasSymbol ? undefined : result;
|
||||
}).bind(null, JSON.stringify.bind(JSON))`).return;
|
||||
|
Loading…
Reference in New Issue
Block a user