From 95913ee3cae618db88b7acca8398a47c64845017 Mon Sep 17 00:00:00 2001 From: fix-fix Date: Wed, 7 Sep 2016 18:07:49 +0500 Subject: [PATCH] Don't treat Object.prototype properties as boolean attributes Keep boolean properties in an object without prototype to prevent false positive checks against attributes with the same name as Object.prototype properties. --- modules/attributes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/attributes.js b/modules/attributes.js index d798a03..9a50259 100644 --- a/modules/attributes.js +++ b/modules/attributes.js @@ -5,7 +5,7 @@ var booleanAttrs = ["allowfullscreen", "async", "autofocus", "autoplay", "checke "required", "reversed", "scoped", "seamless", "selected", "sortable", "spellcheck", "translate", "truespeed", "typemustmatch", "visible"]; -var booleanAttrsDict = {}; +var booleanAttrsDict = Object.create(null); for(var i=0, len = booleanAttrs.length; i < len; i++) { booleanAttrsDict[booleanAttrs[i]] = true; }