const object1 = {
foo: 'Hello, World!',
get bar () { return this.foo }
};
const object2 = Object.assign(Object.create({
get bar () { return this.foo }
}), {
foo: 'Hello, World!'
});
const object3 = Object.freeze({
foo: 'Hello, World!',
get bar () { return this.foo }
});
const object4 = new class {
constructor () {
this.foo = 'Hello, World!';
}
get bar () { return this.foo }
};
const object5 = new ((() => {
function Test () {
this.foo = 'Hello, World!';
}
Object.defineProperty(Test.prototype, 'bar', {
configurable: true,
enumerable: false,
get: function () { return this.foo }
});
return Test;
})());
let result;