@@ -524,48 +524,6 @@ module.exports = {
524524 }
525525 } ,
526526
527- /**
528- * Pre-process the value before piping it through the
529- * filters, and convert non-Array objects to arrays.
530- *
531- * This function will be bound to this directive instance
532- * and passed into the watcher.
533- *
534- * @param {* } value
535- * @return {Array }
536- * @private
537- */
538-
539- _preProcess : function ( value ) {
540- // regardless of type, store the un-filtered raw value.
541- this . rawValue = value
542- var type = this . rawType = typeof value
543- if ( ! isPlainObject ( value ) ) {
544- this . converted = false
545- if ( type === 'number' ) {
546- value = range ( value )
547- } else if ( type === 'string' ) {
548- value = _ . toArray ( value )
549- }
550- return value || [ ]
551- } else {
552- // convert plain object to array.
553- var keys = Object . keys ( value )
554- var i = keys . length
555- var res = new Array ( i )
556- var key
557- while ( i -- ) {
558- key = keys [ i ]
559- res [ i ] = {
560- $key : key ,
561- $value : value [ key ]
562- }
563- }
564- this . converted = true
565- return res
566- }
567- } ,
568-
569527 /**
570528 * Insert an instance.
571529 *
@@ -666,6 +624,64 @@ module.exports = {
666624 return hook
667625 ? hook . call ( vm , index , total )
668626 : index * this [ type ]
627+ } ,
628+
629+ /**
630+ * Pre-process the value before piping it through the
631+ * filters, and convert non-Array objects to arrays.
632+ *
633+ * This function will be bound to this directive instance
634+ * and passed into the watcher.
635+ *
636+ * @param {* } value
637+ * @return {Array }
638+ * @private
639+ */
640+
641+ _preProcess : function ( value ) {
642+ // regardless of type, store the un-filtered raw value.
643+ this . rawValue = value
644+ var type = this . rawType = typeof value
645+ if ( ! isPlainObject ( value ) ) {
646+ this . converted = false
647+ if ( type === 'number' ) {
648+ value = range ( value )
649+ } else if ( type === 'string' ) {
650+ value = _ . toArray ( value )
651+ }
652+ return value || [ ]
653+ } else {
654+ // convert plain object to array.
655+ var keys = Object . keys ( value )
656+ var i = keys . length
657+ var res = new Array ( i )
658+ var key
659+ while ( i -- ) {
660+ key = keys [ i ]
661+ res [ i ] = {
662+ $key : key ,
663+ $value : value [ key ]
664+ }
665+ }
666+ this . converted = true
667+ return res
668+ }
669+ } ,
670+
671+ /**
672+ * Internal hook to do custom transform on the directive's
673+ * descriptor so that it can support special syntax.
674+ *
675+ * @param {Object } descriptor
676+ */
677+
678+ _guard : function ( descriptor ) {
679+ var exp = descriptor . expression
680+ var match = exp . trim ( ) . match ( / ( .* ) i n ( .* ) / )
681+ if ( match ) {
682+ descriptor . arg = match [ 1 ]
683+ descriptor . expression = match [ 2 ]
684+ }
669685 }
670686
671687}
0 commit comments