mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* clean * improve * tests * fix lint * old helpers * add fail test * fix * Update packages/babel-helpers/src/helpers/superPropGet.ts Co-authored-by: Nicolò Ribaudo <[email protected]> * review * fix lint * minVersion --------- Co-authored-by: Nicolò Ribaudo <[email protected]>
19 lines
318 B
JavaScript
19 lines
318 B
JavaScript
const objects = [];
|
|
for (const proto of [{
|
|
x: 0
|
|
}, {
|
|
x: 1
|
|
}]) {
|
|
let _obj;
|
|
if (true) {
|
|
objects.push(_obj = {
|
|
__proto__: proto,
|
|
foo: function () {
|
|
return babelHelpers.superPropGet(_obj, "x", this);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
expect(objects[0].foo()).toBe(0);
|
|
expect(objects[1].foo()).toBe(1);
|