Skip to content

Preserve original constructor name#14

Open
ghost wants to merge 1 commit intoaterris:masterfrom
HaroldPutman:constructor_names
Open

Preserve original constructor name#14
ghost wants to merge 1 commit intoaterris:masterfrom
HaroldPutman:constructor_names

Conversation

@ghost
Copy link

@ghost ghost commented Oct 10, 2013

This improves the debugging output since you can display the class name instead of just Model/View/Collection by adding a named constructor like this:

constructor: function MyModel() {
  Backbone.Model.apply(this, arguments);
 },

The debug output looks more like:

[instance] Model: MyModel:c6

This also improves compatibility with the Backbone-Debugger chrome extension.

This improves the debugging output since you can the class name instead of just Model/View/Collection by adding a named constructor like this:

```js
constructor: function MyModel() {
  Backbone.Model.apply(this, arguments);
 },
```
The debug output looks more like:
```
[instance] Model: MyModel:c6
```
This also improves compatiblity with the Backbone-Debugger (https://github.com/Maluen/Backbone-Debugger/) chrome extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants