Skip to content

Commit

Permalink
validate replacer argument of JSON.stringify, #345
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 11, 2017
1 parent 2b314f8 commit cd78e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/es6.symbol.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
$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 ($replacer) value = $replacer.call(this, key, value);
if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
if (!isSymbol(value)) return value;
};
args[1] = replacer;
Expand Down

0 comments on commit cd78e42

Please sign in to comment.