|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | 3 | /* Dependencies. */ |
4 | | -var has = require('has'); |
5 | 4 | var xtend = require('xtend'); |
6 | 5 | var defaults = require('./github'); |
7 | 6 |
|
8 | 7 | /* Expose. */ |
9 | 8 | module.exports = wrapper; |
10 | 9 |
|
| 10 | +var own = {}.hasOwnProperty; |
| 11 | + |
11 | 12 | /* Schema. */ |
12 | 13 | var NODES = { |
13 | 14 | root: {children: all}, |
@@ -60,7 +61,7 @@ function one(schema, node, stack) { |
60 | 61 | var result; |
61 | 62 | var key; |
62 | 63 |
|
63 | | - if (!has(NODES, type)) { |
| 64 | + if (!own.call(NODES, type)) { |
64 | 65 | replace = false; |
65 | 66 | } else { |
66 | 67 | allowed = xtend(NODES[type], NODES['*']); |
@@ -129,7 +130,7 @@ function handleProperties(schema, properties, node, stack) { |
129 | 130 | var prop; |
130 | 131 | var value; |
131 | 132 |
|
132 | | - allowed = has(attrs, name) ? attrs[name] : []; |
| 133 | + allowed = own.call(attrs, name) ? attrs[name] : []; |
133 | 134 | allowed = [].concat(allowed, attrs['*']); |
134 | 135 |
|
135 | 136 | for (prop in props) { |
@@ -204,7 +205,7 @@ function handleProtocol(schema, value, prop) { |
204 | 205 | var length; |
205 | 206 | var index; |
206 | 207 |
|
207 | | - protocols = has(protocols, prop) ? protocols[prop].concat() : []; |
| 208 | + protocols = own.call(protocols, prop) ? protocols[prop].concat() : []; |
208 | 209 |
|
209 | 210 | if (protocols.length === 0) { |
210 | 211 | return true; |
@@ -263,7 +264,7 @@ function handleTagName(schema, tagName, node, stack) { |
263 | 264 | return false; |
264 | 265 | } |
265 | 266 |
|
266 | | - ancestors = has(ancestors, name) ? ancestors[name] : []; |
| 267 | + ancestors = own.call(ancestors, name) ? ancestors[name] : []; |
267 | 268 |
|
268 | 269 | /* Some nodes can break out of their context if they |
269 | 270 | * don’t have a certain ancestor. */ |
|
0 commit comments