From 5713de8e3dd92a6a702e9bbc1543dc0c4bc00e02 Mon Sep 17 00:00:00 2001 From: Daniel Brooks Date: Wed, 23 Feb 2011 16:02:33 -0600 Subject: [PATCH] [#336] sometimes the manifest is missing entirely, or it has an options object but that object doesn't have a target property --- popcorn.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 ); -- 2.43.0