Skip to content

Commit 1105fd5

Browse files
committed
ignore proto properties
1 parent 65b2f7d commit 1105fd5

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/dot/properties.jst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
, $nextData = 'data' + $dataNxt
2929
, $dataProperties = 'dataProperties' + $lvl;
3030

31-
var $schemaKeys = Object.keys($schema || {})
31+
var $schemaKeys = Object.keys($schema || {}).filter(notProto)
3232
, $pProperties = it.schema.patternProperties || {}
33-
, $pPropertyKeys = Object.keys($pProperties)
33+
, $pPropertyKeys = Object.keys($pProperties).filter(notProto)
3434
, $aProperties = it.schema.additionalProperties
3535
, $someProperties = $schemaKeys.length || $pPropertyKeys.length
3636
, $noAdditional = $aProperties === false
@@ -42,8 +42,11 @@
4242
, $currentBaseId = it.baseId;
4343

4444
var $required = it.schema.required;
45-
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired)
45+
if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
4646
var $requiredHash = it.util.toHash($required);
47+
}
48+
49+
function notProto(p) { return p !== '__proto__'; }
4750
}}
4851

4952

0 commit comments

Comments
 (0)