Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove overwriting of JSON.stringify #59

Open
GillesPl opened this issue Dec 4, 2018 · 0 comments
Open

Remove overwriting of JSON.stringify #59

GillesPl opened this issue Dec 4, 2018 · 0 comments
Assignees
Labels

Comments

@GillesPl
Copy link
Contributor

GillesPl commented Dec 4, 2018

The library overwrites the JSON.stringify function on compilation. This has a negative impact on performance.

// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
var S = $Symbol();
// MS Edge converts symbol values to JSON as {}
// WebKit converts symbol values to JSON as null
// V8 throws on boxed symbols
return _stringify([S]) != '[null]' || _stringify(

{ a: S }
) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
stringify: function stringify(it) {
var args = [it];
var i = 1;
var replacer, $replacer;
while (arguments.length > i) args.push(arguments[i++]);
$replacer = replacer = args[1];
if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
if (!isArray(replacer)) replacer = function (key, value)

{ if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }
;
args[1] = replacer;
return _stringify.apply($JSON, args);
}
});

@GillesPl GillesPl self-assigned this Dec 4, 2018
@GillesPl GillesPl added the bug label Dec 4, 2018
@nakurr nakurr added this to the Release 2.4.0 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants