browser(firefox-stable): merge do not use Array.prototype.toJSON for serialization (#6783)
This commit is contained in:
parent
c8ee008aa1
commit
2f36feefc8
|
|
@ -1,2 +1,2 @@
|
||||||
1256
|
1257
|
||||||
Changed: max@schmitt.mx Thu May 20 19:04:31 UTC 2021
|
Changed: yurys@chromium.org Thu 27 May 2021 04:34:23 PM PDT
|
||||||
|
|
|
||||||
|
|
@ -294,18 +294,24 @@ class ExecutionContext {
|
||||||
this._remoteObjects = new Map();
|
this._remoteObjects = new Map();
|
||||||
this._id = generateId();
|
this._id = generateId();
|
||||||
this._auxData = auxData;
|
this._auxData = auxData;
|
||||||
this._jsonStringifyObject = this._debuggee.executeInGlobal(`((stringify, dateProto, object) => {
|
this._jsonStringifyObject = this._debuggee.executeInGlobal(`((stringify, object) => {
|
||||||
const oldToJson = dateProto.toJSON;
|
const oldToJson = Date.prototype.toJSON;
|
||||||
dateProto.toJSON = undefined;
|
Date.prototype.toJSON = undefined;
|
||||||
|
const oldArrayToJson = Array.prototype.toJSON;
|
||||||
|
Array.prototype.toJSON = undefined;
|
||||||
|
|
||||||
let hasSymbol = false;
|
let hasSymbol = false;
|
||||||
const result = stringify(object, (key, value) => {
|
const result = stringify(object, (key, value) => {
|
||||||
if (typeof value === 'symbol')
|
if (typeof value === 'symbol')
|
||||||
hasSymbol = true;
|
hasSymbol = true;
|
||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
dateProto.toJSON = oldToJson;
|
|
||||||
|
Date.prototype.toJSON = oldToJson;
|
||||||
|
Array.prototype.toJSON = oldArrayToJson;
|
||||||
|
|
||||||
return hasSymbol ? undefined : result;
|
return hasSymbol ? undefined : result;
|
||||||
}).bind(null, JSON.stringify.bind(JSON), Date.prototype)`).return;
|
}).bind(null, JSON.stringify.bind(JSON))`).return;
|
||||||
}
|
}
|
||||||
|
|
||||||
id() {
|
id() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue