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 6591ef7 commit d9678a3Copy full SHA for d9678a3
lib/index.js
@@ -1,6 +1,5 @@
1
'use strict';
2
3
-const hasOwnProperty = Object.prototype.hasOwnProperty;
4
5
const internals = {
6
suspectRx: /"(?:_|\\u005f)(?:_|\\u005f)(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006f)(?:t|\\u0074)(?:o|\\u006f)(?:_|\\u005f)(?:_|\\u005f)"\s*\:/
@@ -66,7 +65,7 @@ exports.scan = function (obj, options) {
66
65
next = [];
67
68
for (const node of nodes) {
69
- if (hasOwnProperty.call(node, '__proto__')) {
+ if (Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly
70
if (options.protoAction !== 'remove') {
71
throw new SyntaxError('Object contains forbidden prototype property');
72
}
0 commit comments