summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/stringify-entities/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/stringify-entities/index.js')
-rw-r--r--tools/eslint/node_modules/stringify-entities/index.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/eslint/node_modules/stringify-entities/index.js b/tools/eslint/node_modules/stringify-entities/index.js
index 93ab625d1e..9ffa29eae9 100644
--- a/tools/eslint/node_modules/stringify-entities/index.js
+++ b/tools/eslint/node_modules/stringify-entities/index.js
@@ -2,7 +2,6 @@
var entities = require('character-entities-html4');
var legacy = require('character-entities-legacy');
-var has = require('has');
var hexadecimal = require('is-hexadecimal');
var alphanumerical = require('is-alphanumerical');
var dangerous = require('./dangerous.json');
@@ -12,6 +11,8 @@ module.exports = encode;
encode.escape = escape;
+var own = {}.hasOwnProperty;
+
/* List of enforced escapes. */
var escapes = ['"', '\'', '<', '>', '&', '`'];
@@ -75,7 +76,7 @@ function one(char, next, options) {
if (
(shortest || options.useNamedReferences) &&
- has(characters, char)
+ own.call(characters, char)
) {
named = toNamed(characters[char], next, omit, options.attribute);
}
@@ -97,7 +98,7 @@ function toNamed(name, next, omit, attribute) {
if (
omit &&
- has(legacy, name) &&
+ own.call(legacy, name) &&
dangerous.indexOf(name) === -1 &&
(!attribute || (next && next !== '=' && !alphanumerical(next)))
) {