File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ var modelProps = {
2020 'false-value' : '_falseValue'
2121}
2222
23+ // regex to test for globally allowed attributes:
24+ // - class
25+ // - data-*
26+ // - aria-*
27+ // - role
28+ var globalAllowedAttrRE = / ^ c l a s s $ | ^ r o l e $ | ^ d a t a - | ^ a r i a - /
29+
2330module . exports = {
2431
2532 priority : 850 ,
@@ -30,17 +37,13 @@ module.exports = {
3037 if ( this . descriptor . interp ) {
3138 // only allow binding on native attributes
3239 if ( ! (
33- // class is allowed globally
34- attr === 'class' ||
35- // data attributes are allowed globally
36- / ^ d a t a - / . test ( attr ) ||
37- // aria attributes are allowed globally
38- / ^ a r i a - / . test ( attr ) ||
39- // role available
40- ( attr === 'role' ) ||
41- // for available
40+ // globally allowed attributes
41+ globalAllowedAttrRE . test ( attr ) ||
42+ // check if "for" is available on current element.
43+ // the corresponding property is a special case.
4244 ( attr === 'for' && 'htmlFor' in this . el ) ||
43- // camelized prop available
45+ // other attributes: check if a camelized property
46+ // is available on the element
4447 _ . camelize ( attr ) in this . el
4548 ) ) {
4649 process . env . NODE_ENV !== 'production' && _ . warn (
You can’t perform that action at this time.
0 commit comments