@babel/plugin-transform-object-super

    1. var _obj;
    2. var _get = function get(object, property, receiver) {
    3. if (object === null) object = Function.prototype;
    4. var desc = Object.getOwnPropertyDescriptor(object, property);
    5. if (desc === undefined) {
    6. var parent = Object.getPrototypeOf(object);
    7. if (parent === null) {
    8. return undefined;
    9. } else {
    10. }
    11. } else if ("value" in desc) {
    12. return desc.value;
    13. var getter = desc.get;
    14. if (getter === undefined) {
    15. return undefined;
    16. }
    17. return getter.call(receiver);
    18. }
    19. };
    20. var obj = {
    21. say: function say() {
    22. return "Hello";
    23. },
    24. say: function say() {
    25. return (
    26. _get(_obj.__proto__ || Object.getPrototypeOf(_obj), "say", this).call(
    27. this
    28. ) + "World!"
    29. );
    30. },
    31. });
    1. {
    2. "plugins": ["@babel/plugin-transform-object-super"]
    3. }
    1. require("@babel/core").transformSync("code", {
    2. plugins: ["@babel/plugin-transform-object-super"],
    3. });