From: rwldrn Date: Thu, 24 Feb 2011 17:46:19 +0000 (-0500) Subject: [#336] Final formatting issues fixed X-Git-Tag: v0.4~35 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3bed562097120ccdfed0ae5a7fcf71a0daee5d9e;p=popcorn-js.git [#336] Final formatting issues fixed --- diff --git a/popcorn.js b/popcorn.js index f73d369..861e516 100644 --- a/popcorn.js +++ b/popcorn.js @@ -685,12 +685,13 @@ setup, isfn = typeof definition === "function"; - if (!manifest) - { + // If `manifest` arg is undefined, check for manifest within the `definition` object + // If no `definition.manifest`, an empty object is a sufficient fallback + if ( !manifest ) { manifest = definition.manifest || {}; } - var pluginFn = function ( setup, options ) { + var pluginFn = function( setup, options ) { if ( !options ) { return this; @@ -719,7 +720,12 @@ // Resolves 239, 241, 242 if ( !options.target ) { + + // Sometimes the manifest may be missing entirely + // or it has an options object that doesn't have a `target` property + var manifestopts = "options" in manifest && manifest.options; + options.target = manifestopts && "target" in manifestopts && manifestopts.target; }