Skip to content

Commit c731598

Browse files
authored
Merge pull request #1 from sirensolutions/INVE-14396
Adding fix to forked repo - sidorares#47
2 parents 390482a + f9c0798 commit c731598

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/parse.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ var json_parse = function (options) {
8888
useNativeBigInt: false, // toggles whether to use native BigInt instead of bignumber.js
8989
protoAction: 'error',
9090
constructorAction: 'error',
91+
objectBaseClass: null, // pass `Object` if you require prototype methods like `hasOwnProperty` for the compatibility with JSON.parse()
9192
};
9293

9394
// If there are options, then use them to override the default _options
@@ -327,7 +328,7 @@ var json_parse = function (options) {
327328
// Parse an object value.
328329

329330
var key,
330-
object = Object.create(null);
331+
object = Object.create(_options.objectBaseClass);
331332

332333
if (ch === '{') {
333334
next('{');

0 commit comments

Comments
 (0)