File tree Expand file tree Collapse file tree
packages/babel-helpers/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,16 +335,17 @@ helpers.inherits = helper("7.0.0-beta.0")`
335335 if (typeof superClass !== "function" && superClass !== null) {
336336 throw new TypeError("Super expression must either be null or a function");
337337 }
338- Object. defineProperty(subClass, " prototype", {
339- value: Object.create(superClass && superClass.prototype, {
340- constructor: {
341- value: subClass,
342- writable: true,
343- configurable: true
344- }
345- }),
346- writable: false,
338+ // We can't use defineProperty to set the prototype in a single step because it
339+ // doesn't work in Chrome <= 36. https://github.com/babel/babel/issues/14056
340+ // V8 bug: https://bugs.chromium.org/p/v8/issues/detail?id=3334
341+ subClass.prototype = Object.create(superClass && superClass.prototype, {
342+ constructor: {
343+ value: subClass,
344+ writable: true,
345+ configurable: true
346+ }
347347 });
348+ Object.defineProperty(subClass, "prototype", { writable: false });
348349 if (superClass) setPrototypeOf(subClass, superClass);
349350 }
350351` ;
You can’t perform that action at this time.
0 commit comments