jsparser icon indicating copy to clipboard operation
jsparser copied to clipboard

Parsing jquery.cloud9carousel.js fails

Open specious opened this issue 10 years ago • 1 comments

Parsing of jquery.cloud9carousel.js fails using the parser demo ( http://www.cjihrig.com/development/jsparser/ ) with error message:

SyntaxError:  Parse error on line 243:
...o rotate    //    this.go = function( 
---------------------^
Expecting ',', ';', got 'THIS'

I have been able to make the parser succeed with any of the following changes:

  • Remove all preceding // comments
@@ -242,9 +242,6 @@
       this.timer = 0;
     }

-    //
-    // Spin the carousel.  Count is the number (+-) of carousel items to rotate
-    //
     this.go = function( count ) {
       this.destRotation += (2 * Math.PI / this.items.length) * count;
       this.play();
  • Insert a comma: ,
@@ -240,7 +240,7 @@
     this.pause = function() {
       this.smooth && cancelFrame ? cancelFrame( this.timer ) : clearTimeout( this.timer );
       this.timer = 0;
-    }
+    },

     //
     // Spin the carousel.  Count is the number (+-) of carousel items to rotate
  • Insert a semicolon: ;
@@ -240,7 +240,7 @@
     this.pause = function() {
       this.smooth && cancelFrame ? cancelFrame( this.timer ) : clearTimeout( this.timer );
       this.timer = 0;
-    }
+    };

     //
     // Spin the carousel.  Count is the number (+-) of carousel items to rotate

specious avatar Nov 23 '15 09:11 specious

Thanks for the report. I haven't really had the time to work on this lately, but I'd take a PR fixing this.

cjihrig avatar Nov 23 '15 17:11 cjihrig