Skip to content

Commit

Permalink
iotjs: error.__stack__ should be non-enumerable (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Jan 16, 2019
1 parent 5c6d793 commit 9fa6808
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/js/iotjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,17 @@
enumerable: false,
get: function() {
if (this.__stack__ === undefined) {
this.__stack__ = `${this.name || 'Error'}: ${this.message}\n` +
makeStackTrace(this.__frames__ || []);
Object.defineProperty(this, '__stack__', {
configurable: true,
writable: true,
enumerable: false,
value: `${this.name || 'Error'}: ${this.message}\n` +
makeStackTrace(this.__frames__ || [])
});
}
return this.__stack__;
},
},
__stack__: {
configurable: true,
writable: true,
enumerable: false,
},
};
Object.defineProperties(Error.prototype, stackPropertiesDescriptor);

Expand Down

0 comments on commit 9fa6808

Please sign in to comment.