@@ -180,7 +180,7 @@ exports.compileAndLinkRoot = function (vm, el, options) {
180
180
}
181
181
} else {
182
182
// non-component, just compile as a normal element.
183
- replacerLinkFn = compileDirectives ( el , options )
183
+ replacerLinkFn = compileDirectives ( el . attributes , options )
184
184
}
185
185
}
186
186
@@ -248,7 +248,7 @@ function compileElement (el, options) {
248
248
}
249
249
// normal directives
250
250
if ( ! linkFn && hasAttrs ) {
251
- linkFn = compileDirectives ( el , options )
251
+ linkFn = compileDirectives ( el . attributes , options )
252
252
}
253
253
// if the element is a textarea, we need to interpolate
254
254
// its content on initial render.
@@ -501,17 +501,12 @@ function makeTerminalNodeLinkFn (el, dirName, value, options, def) {
501
501
/**
502
502
* Compile the directives on an element and return a linker.
503
503
*
504
- * @param {Element|Object } elOrAttrs
505
- * - could be an object of already-extracted
506
- * container attributes.
504
+ * @param {Array|NamedNodeMap } attrs
507
505
* @param {Object } options
508
506
* @return {Function }
509
507
*/
510
508
511
- function compileDirectives ( elOrAttrs , options ) {
512
- var attrs = _ . isPlainObject ( elOrAttrs )
513
- ? mapToList ( elOrAttrs )
514
- : elOrAttrs . attributes
509
+ function compileDirectives ( attrs , options ) {
515
510
var i = attrs . length
516
511
var dirs = [ ]
517
512
var attr , name , value , dir , dirName , dirDef
@@ -546,24 +541,6 @@ function compileDirectives (elOrAttrs, options) {
546
541
}
547
542
}
548
543
549
- /**
550
- * Convert a map (Object) of attributes to an Array.
551
- *
552
- * @param {Object } map
553
- * @return {Array }
554
- */
555
-
556
- function mapToList ( map ) {
557
- var list = [ ]
558
- for ( var key in map ) {
559
- list . push ( {
560
- name : key ,
561
- value : map [ key ]
562
- } )
563
- }
564
- return list
565
- }
566
-
567
544
/**
568
545
* Build a link function for all directives on a single node.
569
546
*
0 commit comments