Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. function BaseError(message) {
  2. _super.call(this, message);
  3. // Errors don't use current this, instead they create a new instance.
  4. // We have to do forward all of our api to the nativeInstance.
  5. // TODO(bradfordcsmith): Remove this hack when
  6. // google/closure-compiler/issues/2102 is fixed.
  7. var nativeError = new Error(message);
  8. this._nativeError = nativeError;
  9. }
  10. Object.defineProperty(BaseError.prototype, "message", {
  11. /**
  12. * @return {?}
  13. */
  14. get: function () { return this._nativeError.message; },
  15. /**
  16. * @param {?} message
  17. * @return {?}
  18. */
  19. set: function (message) { this._nativeError.message = message; },
  20. enumerable: true,
  21. configurable: true
  22. });
  23. Object.defineProperty(BaseError.prototype, "name", {
  24. /**
  25. * @return {?}
  26. */
  27. get: function () { return this._nativeError.name; },
  28. enumerable: true,
  29. configurable: true
  30. });
  31. Object.defineProperty(BaseError.prototype, "stack", {
  32. /**
  33. * @return {?}
  34. */
  35. get: function () { return ((this._nativeError)).stack; },
  36. /**
  37. * @param {?} value
  38. * @return {?}
  39. */
  40. set: function (value) { ((this._nativeError)).stack = value; },
  41. enumerable: true,
  42. configurable: true
  43. });
  44. /**
  45. * @return {?}
  46. */
  47. BaseError.prototype.toString = function () { return this._nativeError.toString(); };
  48. return BaseError;
  49. }(Error));
  50. function BaseError_tsickle_Closure_declarations() {
  51. /** @type {?} */
  52. BaseError.prototype._nativeError;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement