Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View file

@ -0,0 +1,53 @@
// prettier-ignore
test("new-expression parsing", () => {
function Foo() {
this.x = 1;
}
let foo = new Foo();
expect(foo.x).toBe(1);
foo = new Foo
expect(foo.x).toBe(1);
foo = new
Foo
();
expect(foo.x).toBe(1);
foo = new Foo + 2
expect(foo).toBe("[object Object]2");
});
// prettier-ignore
test("new-expressions with object keys", () => {
let a = {
b: function () {
this.x = 2;
},
};
foo = new a.b();
expect(foo.x).toBe(2);
foo = new a.b;
expect(foo.x).toBe(2);
foo = new
a.b();
expect(foo.x).toBe(2);
});
test("new-expressions with function calls", () => {
function funcGetter() {
return function (a, b) {
this.x = a + b;
};
}
foo = new funcGetter()(1, 5);
expect(foo).toBeUndefined();
foo = new (funcGetter())(1, 5);
expect(foo.x).toBe(6);
});