| 1 |
var _x = new WeakMap(); |
| 2 |
var _y = new WeakMap(); |
| 3 |
var Point = function () { |
| 4 |
"use strict"; |
| 5 |
|
| 6 |
function Point(x = 0, y = 0) { |
| 7 |
babelHelpers.classCallCheck(this, Point); |
| 8 |
babelHelpers.classPrivateFieldInitSpec(this, _x, { |
| 9 |
writable: true, |
| 10 |
value: void 0 |
| 11 |
}); |
| 12 |
babelHelpers.classPrivateFieldInitSpec(this, _y, { |
| 13 |
writable: true, |
| 14 |
value: void 0 |
| 15 |
}); |
| 16 |
babelHelpers.classPrivateFieldSet(this, _x, +x); |
| 17 |
babelHelpers.classPrivateFieldSet(this, _y, +y); |
| 18 |
} |
| 19 |
babelHelpers.createClass(Point, [{ |
| 20 |
key: "x", |
| 21 |
get: function () { |
| 22 |
return babelHelpers.classPrivateFieldGet(this, _x); |
| 23 |
}, |
| 24 |
set: function (value) { |
| 25 |
babelHelpers.classPrivateFieldSet(this, _x, +value); |
| 26 |
} |
| 27 |
}, { |
| 28 |
key: "y", |
| 29 |
get: function () { |
| 30 |
return babelHelpers.classPrivateFieldGet(this, _y); |
| 31 |
}, |
| 32 |
set: function (value) { |
| 33 |
babelHelpers.classPrivateFieldSet(this, _y, +value); |
| 34 |
} |
| 35 |
}, { |
| 36 |
key: "equals", |
| 37 |
value: function equals(p) { |
| 38 |
return babelHelpers.classPrivateFieldGet(this, _x) === babelHelpers.classPrivateFieldGet(p, _x) && babelHelpers.classPrivateFieldGet(this, _y) === babelHelpers.classPrivateFieldGet(p, _y); |
| 39 |
} |
| 40 |
}, { |
| 41 |
key: "toString", |
| 42 |
value: function toString() { |
| 43 |
return `Point<${babelHelpers.classPrivateFieldGet(this, _x)},${babelHelpers.classPrivateFieldGet(this, _y)}>`; |
| 44 |
} |
| 45 |
}]); |
| 46 |
return Point; |
| 47 |
}(); |