mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibJS/Bytecode: Don't clobber dst when assigning from object expression
When compiling code like this:
x = { foo: x }
We don't want to put a new JS::Object in `x` until *after* we've
evaluated `x` for the `foo` field.
This fixes an issue when loading https://puter.com/ :^)
This commit is contained in:
@@ -122,6 +122,14 @@ describe("correct behavior", () => {
|
||||
Object.setPrototypeOf(derived, base);
|
||||
expect(derived.getNumber()).toBe(30);
|
||||
});
|
||||
|
||||
test("assigning object expression with destination referenced in object expression", () => {
|
||||
function go(i) {
|
||||
var i = { f: i };
|
||||
return i;
|
||||
}
|
||||
expect(go("foo")).toEqual({ f: "foo" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("side effects", () => {
|
||||
|
||||
Reference in New Issue
Block a user