mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 05:32:59 +00:00
LibJS: Indent tests with 4 spaces instead of 2
This commit is contained in:
parent
15de2eda2b
commit
1ef573eb30
Notes:
sideshowbarker
2024-07-19 05:03:50 +09:00
Author: https://github.com/mattco98
Commit: 1ef573eb30
Pull-request: https://github.com/SerenityOS/serenity/pull/2689
Reviewed-by: https://github.com/linusg
261 changed files with 8536 additions and 8497 deletions
|
@ -1,80 +1,80 @@
|
|||
describe("non-syntax errors", () => {
|
||||
test("super reference inside nested-but-same |this| scope with no base class", () => {
|
||||
expect(`
|
||||
test("super reference inside nested-but-same |this| scope with no base class", () => {
|
||||
expect(`
|
||||
class A {
|
||||
foo() {
|
||||
() => { super.bar; }
|
||||
}
|
||||
}`).toEval();
|
||||
});
|
||||
});
|
||||
|
||||
test("super reference property lookup with no base class", () => {
|
||||
expect(`
|
||||
test("super reference property lookup with no base class", () => {
|
||||
expect(`
|
||||
class A {
|
||||
constructor() {
|
||||
super.foo;
|
||||
}
|
||||
}`).toEval();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("reference errors", () => {
|
||||
test("derived class doesn't call super in constructor before using this", () => {
|
||||
class Parent {}
|
||||
class Child extends Parent {
|
||||
constructor() {
|
||||
this;
|
||||
}
|
||||
}
|
||||
test("derived class doesn't call super in constructor before using this", () => {
|
||||
class Parent {}
|
||||
class Child extends Parent {
|
||||
constructor() {
|
||||
this;
|
||||
}
|
||||
}
|
||||
|
||||
expect(() => {
|
||||
new Child();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| has not been initialized");
|
||||
});
|
||||
expect(() => {
|
||||
new Child();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| has not been initialized");
|
||||
});
|
||||
|
||||
test("derived class calls super twice in constructor", () => {
|
||||
class Parent {}
|
||||
class Child extends Parent {
|
||||
constructor() {
|
||||
super();
|
||||
super();
|
||||
}
|
||||
}
|
||||
test("derived class calls super twice in constructor", () => {
|
||||
class Parent {}
|
||||
class Child extends Parent {
|
||||
constructor() {
|
||||
super();
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
expect(() => {
|
||||
new Child();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| is already initialized");
|
||||
});
|
||||
expect(() => {
|
||||
new Child();
|
||||
}).toThrowWithMessage(ReferenceError, "|this| is already initialized");
|
||||
});
|
||||
});
|
||||
|
||||
describe("syntax errors", () => {
|
||||
test("getter with argument", () => {
|
||||
expect(`
|
||||
test("getter with argument", () => {
|
||||
expect(`
|
||||
class A {
|
||||
get foo(v) {
|
||||
return 0;
|
||||
}
|
||||
}`).not.toEval();
|
||||
});
|
||||
});
|
||||
|
||||
test("setter with no arguments", () => {
|
||||
expect(`
|
||||
test("setter with no arguments", () => {
|
||||
expect(`
|
||||
class A {
|
||||
set foo() {
|
||||
}
|
||||
}`).not.toEval();
|
||||
});
|
||||
});
|
||||
|
||||
test("setter with more than one argument", () => {
|
||||
expect(`
|
||||
test("setter with more than one argument", () => {
|
||||
expect(`
|
||||
class A {
|
||||
set foo(bar, baz) {
|
||||
}
|
||||
}`).not.toEval();
|
||||
});
|
||||
});
|
||||
|
||||
test("super reference inside different |this| scope", () => {
|
||||
expect(`
|
||||
test("super reference inside different |this| scope", () => {
|
||||
expect(`
|
||||
class Parent {}
|
||||
|
||||
class Child extends Parent {
|
||||
|
@ -82,14 +82,14 @@ describe("syntax errors", () => {
|
|||
function f() { super.foo; }
|
||||
}
|
||||
}`).not.toEval();
|
||||
});
|
||||
});
|
||||
|
||||
test("super reference call with no base class", () => {
|
||||
expect(`
|
||||
test("super reference call with no base class", () => {
|
||||
expect(`
|
||||
class A {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}`).not.toEval();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue