Dear folks, what should I do with these error warnings that Closure Compiler outputs? Thank you very much for your ideas and code improtements on this particular type of error:
JSC_WRONG_ARGUMENT_COUNT: Function parseInt: called with 1 argument(s). Function requires at least 2 argument(s) and no more than 2 argument(s). at line 593 character 12if (parseInt(jQuery.browser.version) < 7) {
JSC_NOT_A_CONSTRUCTOR: cannot instantiate non-constructor at line 708 character 15lightbox = new Lightbox(this, opts.lightbox);
JSC_NOT_A_CONSTRUCTOR: cannot instantiate non-constructor at line 1265 character 19var scroller = new Scroller($(this), opts);
Number 1:
This warning means that you passed-in the wrong number of arguments in a function call.
Here is a better explanation
Number 2 & 3:
The compiler expects all constructors to be marked with the JSDoc tag @constructor, like this:
/**
* @constructor
*/
function MyClass() {
this.foo = 'bar';
}
var obj = new MyClass();
alert(obj.foo);
Here is a better explanation.
For the first one, it wants you to pass two parameters to parseInt: value and radix. For 10-based numbers (which is your case), you need (don't really need but it wants you to) call
parseInt(jQuery.browser.version, 10)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With