I\'m working on a jQuery plugin that allows you to log any javascript class or object. The idea is to override each function inside the object, or prototype of a function.
Well look closely to the error.
Uncaught ReferenceError: name is not defined
Means you haven't defined name and since you are in strict mode, you can't use a variable without defining it(normally if you do it, it'll be a global variable, but not in strict mode). So if you write a var name
before it you won't get this error anymore.
Though there is another error for not having tab method. The other error says tabs
is not a method of the object which is because when you wrap the function, you didn't inherit the prototype, so when the function is called with new, it doesn't have prototype functions(tabs
is one of them).
Here's the fixed code : http://jsfiddle.net/Sj6xN/8/