]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
apply function isn't really needed now that there's only once call site
authorDaniel Brooks <db48x@db48x.net>
Thu, 24 Mar 2011 22:57:20 +0000 (17:57 -0500)
committerDaniel Brooks <db48x@db48x.net>
Thu, 24 Mar 2011 22:57:20 +0000 (17:57 -0500)
popcorn.js

index bddfdcd97d7752981212df25ca40347389edae21..17359453c23aeffb3b1903a5413a49b599b00a57 100644 (file)
 
     return Popcorn.plugin( name, function( options ) {
       var self = this;
-      function instantiate( p, options ) { return (typeof p === "function") ? p.call( self, options ) : p; }
-      function apply( fn, args ) { return fn && fn.apply( self, args ); }
+      function instantiate( p, options ) {
+        return (typeof p === "function") ? p.call( self, options ) : p;
+      }
       function delegate( name ) {
         return function() {
           plugins.forEach( function( p ) {
-            apply( p[name], arguments );
+            p[name] && p[name].apply( self, arguments );
           });
         };
       }