We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 390482a commit f9c0798Copy full SHA for f9c0798
lib/parse.js
@@ -88,6 +88,7 @@ var json_parse = function (options) {
88
useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js
89
protoAction: 'error',
90
constructorAction: 'error',
91
+ objectBaseClass: null, // pass `Object` if you require prototype methods like `hasOwnProperty` for the compatibility with JSON.parse()
92
};
93
94
// If there are options, then use them to override the default _options
@@ -327,7 +328,7 @@ var json_parse = function (options) {
327
328
// Parse an object value.
329
330
var key,
- object = Object.create(null);
331
+ object = Object.create(_options.objectBaseClass);
332
333
if (ch === '{') {
334
next('{');
0 commit comments