New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After using extend function, the child name is not appropriate #4079
Projects
Comments
I am willing to provide a solution. Before doing that, I would like to know whether it is really valuable for most developers. |
There are two possible solutions:
This has a very low priority as far as I'm concerned, because classes in JavaScript are an illusion anyway, but pull requests for option 2 are welcome. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As in the definition of var extend = function(protoProps, staticProps) ,
child = function(){ return parent.apply(this, arguments); };
the return child function's name is set as 'child'.
Thus, any new object created by the child function, when you inspect them in Chrome, the name of constructor is displayed as 'child'.
Would it be better to display the name of constructor using parent constructor's name ?
From my point of view, it gives developers intuitive overview what the object essentially is. In previous case, "Backbone.Collection" should be displayed after todos.
Because
I was using the todo list example http://todomvc.com/examples/backbone/
The text was updated successfully, but these errors were encountered: