Skip to content

Commit

Permalink
Merge pull request #195 from mbjurman/ImmutableError-should-be-an-error
Browse files Browse the repository at this point in the history
Changed ImmutableError to be an instance of Error
  • Loading branch information
Richard Feldman authored Feb 12, 2017
2 parents c85562d + b6b3843 commit 5068f09
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 16 deletions.
11 changes: 5 additions & 6 deletions seamless-immutable.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,12 @@ function immutableInit(config) {
]);

function ImmutableError(message) {
var err = new Error(message);
// TODO: Consider `Object.setPrototypeOf(err, ImmutableError);`
err.__proto__ = ImmutableError;

return err;
this.name = 'MyError';
this.message = message;
this.stack = (new Error()).stack;
}
ImmutableError.prototype = Error.prototype;
ImmutableError.prototype = new Error;
ImmutableError.prototype.constructor = Error;

function makeImmutable(obj, bannedMethods) {
// Tag it so we can quickly tell it's immutable later.
Expand Down
2 changes: 1 addition & 1 deletion seamless-immutable.development.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5068f09

Please sign in to comment.