Skip to content

Commit

Permalink
fixup! feat: add agoric-upgrade-18 (proposal 83)
Browse files Browse the repository at this point in the history
add patches
  • Loading branch information
mujahidkay committed Jan 13, 2025
1 parent 6454613 commit 8cb322e
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/dist/node/axios.cjs b/dist/node/axios.cjs
index db4997bee1aa48aca215c6b2e7443292c94c086f..fb39f7e0046c66b1c0275c1a82ed49d3cc7cff83 100644
--- a/dist/node/axios.cjs
+++ b/dist/node/axios.cjs
@@ -371,9 +371,18 @@ function merge(/* obj1, obj2, obj3, ... */) {
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
forEach(b, (val, key) => {
if (thisArg && isFunction(val)) {
- a[key] = bind(val, thisArg);
- } else {
+ val = bind(val, thisArg);
+ }
+ const oldDesc = Object.getOwnPropertyDescriptor(a, key);
+ if (oldDesc) {
a[key] = val;
+ } else {
+ Object.defineProperty(a, key, {
+ value: val,
+ writable: true,
+ enumerable: true,
+ configurable: true
+ });
}
}, {allOwnKeys});
return a;
@@ -404,7 +413,9 @@ const stripBOM = (content) => {
*/
const inherits = (constructor, superConstructor, props, descriptors) => {
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
- constructor.prototype.constructor = constructor;
+ Object.defineProperty(constructor.prototype, 'constructor', {
+ value: constructor
+ });
Object.defineProperty(constructor, 'super', {
value: superConstructor.prototype
});
@@ -566,7 +577,7 @@ const isRegExp = kindOfTest('RegExp');

const reduceDescriptors = (obj, reducer) => {
const descriptors = Object.getOwnPropertyDescriptors(obj);
- const reducedDescriptors = {};
+ const reducedDescriptors = Object.create(null);

forEach(descriptors, (descriptor, name) => {
let ret;
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/src/util/minimal.js b/src/util/minimal.js
index 3c406dee753b5c6fb29dda2e64d4482e754e7873..564e5dadaa50e4ad05fc18b767ee276c99e9f0f9 100644
--- a/src/util/minimal.js
+++ b/src/util/minimal.js
@@ -280,7 +280,30 @@ function newError(name) {
merge(this, properties);
}

- (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;
+ CustomError.prototype = Object.create(Error.prototype, {
+ constructor: {
+ value: CustomError,
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ },
+ name: {
+ get() { return name; },
+ set: undefined,
+ enumerable: false,
+ // configurable: false would accurately preserve the behavior of
+ // the original, but I'm guessing that was not intentional.
+ // For an actual error subclass, this property would
+ // be configurable.
+ configurable: true,
+ },
+ toString: {
+ value() { return this.name + ": " + this.message; },
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ },
+ });

Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } });

0 comments on commit 8cb322e

Please sign in to comment.