From: Daniel Brooks Date: Wed, 23 Feb 2011 22:02:33 +0000 (-0600) Subject: [#336] sometimes the manifest is missing entirely, or it has an options object but... X-Git-Tag: v0.4~38 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=5713de8e3dd92a6a702e9bbc1543dc0c4bc00e02;p=popcorn-js.git [#336] sometimes the manifest is missing entirely, or it has an options object but that object doesn't have a target property --- diff --git a/popcorn.js b/popcorn.js index 8c98986..f73d369 100644 --- a/popcorn.js +++ b/popcorn.js @@ -685,6 +685,11 @@ setup, isfn = typeof definition === "function"; + if (!manifest) + { + manifest = definition.manifest || {}; + } + var pluginFn = function ( setup, options ) { if ( !options ) { @@ -697,7 +702,7 @@ options._running = false; // Ensure a manifest object, an empty object is a sufficient fallback - options._natives.manifest = manifest || setup.manifest || {}; + options._natives.manifest = manifest; // Checks for expected properties if ( !( "start" in options ) ) { @@ -714,8 +719,8 @@ // Resolves 239, 241, 242 if ( !options.target ) { - options.target = ( manifest && manifest.options.target ) || - ( "manifest" in setup && setup.manifest.options.target ); + var manifestopts = "options" in manifest && manifest.options; + options.target = manifestopts && "target" in manifestopts && manifestopts.target; } setup._setup.call( this, options );