mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:47:45 +00:00
LibJS: Remove Proxy() argument count check
Let's just treat missing arguments as undefined and throw with 'target/handler must be object' - this is more JavaScript-y.
This commit is contained in:
parent
5ff85abe8c
commit
e39dd65cf0
3 changed files with 8 additions and 8 deletions
|
@ -7,11 +7,17 @@ test("constructs properly", () => {
|
|||
test("constructor argument count", () => {
|
||||
expect(() => {
|
||||
new Proxy();
|
||||
}).toThrowWithMessage(TypeError, "Proxy constructor requires at least two arguments");
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Expected target argument of Proxy constructor to be object, got undefined"
|
||||
);
|
||||
|
||||
expect(() => {
|
||||
new Proxy({});
|
||||
}).toThrowWithMessage(TypeError, "Proxy constructor requires at least two arguments");
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"Expected handler argument of Proxy constructor to be object, got undefined"
|
||||
);
|
||||
});
|
||||
|
||||
test("constructor requires objects", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue