Skip to content

Commit

Permalink
Warn on use of defaultAttrs in debug mode
Browse files Browse the repository at this point in the history
Fix #336.
  • Loading branch information
Tom Ashworth committed Jan 30, 2015
1 parent 25ad186 commit 04fb2eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ define(
}

function initDeprecatedAttributes(attrs) {
if (debug.enabled) {
debug.warn.call(this, 'defaultAttrs will be removed in a future version. Please use attributes.');
}

// merge defaults with supplied options
// put options in attr.__proto__ to avoid merge overhead
var attr = Object.create(attrs);
Expand Down
2 changes: 1 addition & 1 deletion lib/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ define(
warn: function (message) {
if (!window.console) { return; }
var fn = (console.warn || console.log);
fn.call(console, this.toString() + ': ' + message);
fn.call(console, this.toString() + ': ' + message);
},

registry: registry,
Expand Down

0 comments on commit 04fb2eb

Please sign in to comment.