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