plugin = {},
setup;
- function pluginFn ( setup, options ) {
+ var pluginFn = function ( setup, options ) {
if ( !options ) {
return this;
Popcorn.manifest[ name ] = manifest || definition.manifest;
}
+ var isfn = typeof definition === "function";
// Assign new named definition
plugin[ name ] = function( options ) {
- return pluginFn.call( this, typeof definition === "function" ?
- definition.call( this, options ) :
- definition, options );
+ return pluginFn.call( this,
+ isfn ? definition.call( this, options )
+ : definition, options );
};
// Extend Popcorn.p with new named definition
options.endCount = 0;
},
start: function ( event, options ) {
- // test is run four times. Two closure tracks, called twice each
+ // called once for each instance; the test will fail if startCount is not actually unique per instance
equals( startCount++, options.startCount++, options.nick + " has correct start counts" );
plus();
},
end: function ( event, options ) {
- // test is run four times. Two closure tracks, called twice each
+ // likewise for endCount
equals( endCount++, options.endCount++, options.nick + " has correct end counts" );
plus();