diff --git a/lib/parse.js b/lib/parse.js index bb4e5eb..347890d 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -88,6 +88,7 @@ var json_parse = function (options) { useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js protoAction: 'error', constructorAction: 'error', + objectBaseClass: null, // pass `Object` if you require prototype methods like `hasOwnProperty` for the compatibility with JSON.parse() }; // If there are options, then use them to override the default _options @@ -327,7 +328,7 @@ var json_parse = function (options) { // Parse an object value. var key, - object = Object.create(null); + object = Object.create(_options.objectBaseClass); if (ch === '{') { next('{');