Skip to content

Commit

Permalink
Fix Ember.Error properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Aug 29, 2012
1 parent 0ea255a commit e71b40a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/ember-runtime/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,11 @@ if (!Ember.keys) {
Ember.Error = function() {
var tmp = Error.prototype.constructor.apply(this, arguments);

for (var p in tmp) {
if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
var props = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'], idx;

This comment has been minimized.

Copy link
@krisselden

krisselden Aug 29, 2012

Contributor

props can be created once

for (idx = 0; idx < props.length; idx++) {
this[props[idx]] = tmp[props[idx]];
}
this.message = tmp.message;
};

Ember.Error.prototype = Ember.create(Error.prototype);

0 comments on commit e71b40a

Please sign in to comment.