A closure name clashes with function of same name inside it, but only in Chrome A closure name clashes with function of same name inside it, but only in Chrome google-chrome google-chrome

A closure name clashes with function of same name inside it, but only in Chrome


Probably not the exact problem, but you unnecessarily named the function expression.

var closure = (function Button(){    //the closure's primary object    function Button(target) {        //constructor for our button object    }    Button.prototype = e.inherit(e.Plugin.prototype);    Button.prototype.constructor = Button;    return {            Button: Button,        };}());//now let's call our closure to create a new Buttonvar newButton = new closure.Button()

Should be

var closure = (function (){    //the closure's primary object    function Button(target) {        //constructor for our button object    }    Button.prototype = e.inherit(e.Plugin.prototype);    Button.prototype.constructor = Button;    return {            Button: Button        };}());//now let's call our closure to create a new Buttonvar newButton = new closure.Button();

The difference being that the top level function is unnamed. No need to name something you will never use again.

Also, you should not have a comma within the return object. This should come up as a syntax error.

Also, you have no closing semi colon on the last line.