@@ -496,9 +496,9 @@ Type.prototype.$asArray = function(mode, isSearch) {
496496 return new ArrayType ( this , mode ) ;
497497
498498 function ArrayType ( type , mode ) {
499- function bindTo ( thisObj , callback ) {
499+ function bindTo ( type , callbackName ) {
500500 return function ( ) {
501- return callback . apply ( thisObj , arguments ) ;
501+ return type [ callbackName ] . apply ( type , arguments ) ;
502502 } ;
503503 }
504504
@@ -537,10 +537,10 @@ Type.prototype.$asArray = function(mode, isSearch) {
537537 } ;
538538 }
539539
540- this . encode = arrayHandler ( bindTo ( this , type . encode ) ) ;
541- this . decode = arrayHandler ( bindTo ( this , type . decode ) ) ;
542- this . is = arrayHandler ( bindTo ( this , type . is ) , true ) ;
543- this . equals = arrayEqualsHandler ( bindTo ( this , type . equals ) ) ;
540+ this . encode = arrayHandler ( bindTo ( type , ' encode' ) ) ;
541+ this . decode = arrayHandler ( bindTo ( type , ' decode' ) ) ;
542+ this . is = arrayHandler ( bindTo ( type , 'is' ) , true ) ;
543+ this . equals = arrayEqualsHandler ( bindTo ( type , ' equals' ) ) ;
544544 this . pattern = type . pattern ;
545545 this . $arrayMode = mode ;
546546 }
0 commit comments