| 1 |
var oldReflect = this.Reflect; |
| 2 |
var oldHTMLElement = this.HTMLElement; |
| 3 |
try { |
| 4 |
// Pretend that `Reflect.construct` isn't supported. |
| 5 |
this.Reflect = undefined; |
| 6 |
this.HTMLElement = function () { |
| 7 |
// Here, `this.HTMLElement` is this function, not the original HTMLElement |
| 8 |
// constructor. `this.constructor` should be this function too, but isn't. |
| 9 |
constructor = this.constructor; |
| 10 |
}; |
| 11 |
var constructor; |
| 12 |
var CustomElement = /*#__PURE__*/function (_HTMLElement) { |
| 13 |
"use strict"; |
| 14 |
|
| 15 |
babelHelpers.inherits(CustomElement, _HTMLElement); |
| 16 |
var _super = babelHelpers.createSuper(CustomElement); |
| 17 |
function CustomElement() { |
| 18 |
babelHelpers.classCallCheck(this, CustomElement); |
| 19 |
return _super.apply(this, arguments); |
| 20 |
} |
| 21 |
return babelHelpers.createClass(CustomElement); |
| 22 |
}( /*#__PURE__*/babelHelpers.wrapNativeSuper(HTMLElement)); |
| 23 |
; |
| 24 |
new CustomElement(); |
| 25 |
expect(constructor).toBe(CustomElement); |
| 26 |
} finally { |
| 27 |
// Restore original env |
| 28 |
this.Reflect = oldReflect; |
| 29 |
this.HTMLElement = oldHTMLElement; |
| 30 |
} |