@babel/plugin-transform-proto-to-assign

    1. var bar = { b: 2 };
    2. bar.__proto__ = foo;
    3. bar.a; // 1
    4. foo.a = 2;
    1. function _defaults(obj, defaults) { ... }
    2. _defaults(bar, foo);
    1. {
    2. }
    1. require("@babel/core").transformSync("code", {
    2. plugins: ["@babel/plugin-transform-proto-to-assign"],
    3. });