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.
pull/161/head
fix-fix 9 years ago
parent 4fe2f5fedf
commit 95913ee3ca

@ -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;
}

Loading…
Cancel
Save