endo icon indicating copy to clipboard operation
endo copied to clipboard

Compatibility: regenerator-runtime

Open kumavis opened this issue 4 years ago • 3 comments

conflict is Object.prototype.constructor

metamask-extension3/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js https://npmfs.com/package/regenerator-runtime/0.11.1/runtime.js#L105

function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}

// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
var IteratorPrototype = {};
IteratorPrototype[iteratorSymbol] = function () {
  return this;
};

var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype &&
    NativeIteratorPrototype !== Op &&
    hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  // This environment has a native %IteratorPrototype%; use it instead
  // of the polyfill.
  IteratorPrototype = NativeIteratorPrototype;
}

var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; // < ----------- explodes here 

kumavis avatar Mar 17 '21 06:03 kumavis

Closing as won't fix. But see https://github.com/endojs/endo/issues/576#issuecomment-800840188 We should report this bug upstream to regenerator-runtime.

erights avatar Mar 17 '21 06:03 erights

although this has been fixed for a long time in the regenerator-runtime, there are still many packages bundles of the old version of it. I think it is necessary to have a new taming for this.

Jack-Works avatar Jun 20 '24 16:06 Jack-Works

Hi @Jack-Works , Reopening, thanks. Do you have a taming in mind? Happy to review a PR.

erights avatar Jun 20 '24 19:06 erights