| 1 |
// [Symbol.toPrimitive] must be called if exist |
| 2 |
var counter = 0; |
| 3 |
new ( /*#__PURE__*/function () { |
| 4 |
"use strict"; |
| 5 |
|
| 6 |
function _class() { |
| 7 |
babelHelpers.classCallCheck(this, _class); |
| 8 |
} |
| 9 |
babelHelpers.createClass(_class, [{ |
| 10 |
key: "f", |
| 11 |
value: function f() { |
| 12 |
babelHelpers.toPropertyKey({ |
| 13 |
[Symbol.toPrimitive]: function () { |
| 14 |
++counter; |
| 15 |
return 0; |
| 16 |
} |
| 17 |
}), function () { |
| 18 |
throw new ReferenceError("'delete super[expr]' is invalid"); |
| 19 |
}(); |
| 20 |
} |
| 21 |
}]); |
| 22 |
return _class; |
| 23 |
}())().f(); |
| 24 |
|
| 25 |
// [Symbol.toPrimitive] must return a primitive value |
| 26 |
new ( /*#__PURE__*/function () { |
| 27 |
"use strict"; |
| 28 |
|
| 29 |
function _class2() { |
| 30 |
babelHelpers.classCallCheck(this, _class2); |
| 31 |
} |
| 32 |
babelHelpers.createClass(_class2, [{ |
| 33 |
key: "f", |
| 34 |
value: function f() { |
| 35 |
babelHelpers.toPropertyKey({ |
| 36 |
[Symbol.toPrimitive]: function () { |
| 37 |
return {}; |
| 38 |
} |
| 39 |
}), function () { |
| 40 |
throw new ReferenceError("'delete super[expr]' is invalid"); |
| 41 |
}(); |
| 42 |
} |
| 43 |
}]); |
| 44 |
return _class2; |
| 45 |
}())().f(); |