]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#336] sometimes the manifest is missing entirely, or it has an options object but...
authorDaniel Brooks <db48x@db48x.net>
Wed, 23 Feb 2011 22:02:33 +0000 (16:02 -0600)
committerDaniel Brooks <db48x@db48x.net>
Wed, 23 Feb 2011 22:02:33 +0000 (16:02 -0600)
popcorn.js

index 8c98986a110618e8a50c094a6fa0eb5ab04afe80..f73d3696440d7fca798a92d802fcaa944f226eaa 100644 (file)
         setup,
         isfn = typeof definition === "function";
 
+    if (!manifest)
+    {
+      manifest = definition.manifest || {};
+    }
+
     var pluginFn = function ( setup, options ) {
 
       if ( !options ) {
       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 ) ) {
 
         // 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 );