Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Computed properties should keep original definition order #15232

Merged
merged 12 commits into from
Dec 5, 2022
Prev Previous commit
Next Next commit
Update test spec/definition-order
  • Loading branch information
SuperSodaSea committed Nov 29, 2022
commit c7351351bfcefe7cf1db19298f5af0347a4abb8c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var b = {
};
expect(b.x).toBe(1);

var x = { x, get x() { return 0; }, x };
expect(x.x).toBe(undefined);
x.x = 1;
expect(x.x).toBe(1);
var x = 1;
var y = { x, get x() { return 0; }, x };
expect(y.x).toBe(1);
y.x = 2;
expect(y.x).toBe(2);
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ var b = {
["x"]: 1,
};

var x = { x, get x() { return 0; }, x };
x.x = 1;
var x = 1;
var y = { x, get x() { return 0; }, x };
y.x = 2;
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
var _a, _b, _x;
var _a, _b, _y;
var a = (_a = {}, babelHelpers.defineAccessor("get", _a, "x", function () {
return 0;
}), babelHelpers.defineProperty(_a, "y", 1), _a);
var b = (_b = {}, babelHelpers.defineAccessor("get", _b, "x", function () {
return 0;
}), babelHelpers.defineProperty(_b, "x", 1), _b);
var x = (_x = {
var x = 1;
var y = (_y = {
x
}, babelHelpers.defineAccessor("get", _x, "x", function () {
}, babelHelpers.defineAccessor("get", _y, "x", function () {
return 0;
}), babelHelpers.defineProperty(_x, "x", x), _x);
x.x = 1;
}), babelHelpers.defineProperty(_y, "x", x), _y);
y.x = 2;