mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
LibJS: Bring Reflect.construct() closer to the specification
This includes checking that the target is a constructor, not just a function, as well as switching the order of the list creation and argument validation to match the specification, to ensure correct exception throwing order.
This commit is contained in:
parent
596324ae9c
commit
8eb48039c9
Notes:
sideshowbarker
2024-07-18 11:25:30 +09:00
Author: https://github.com/IdanHo
Commit: 8eb48039c9
Pull-request: https://github.com/SerenityOS/serenity/pull/8289
Reviewed-by: https://github.com/linusg
3 changed files with 21 additions and 24 deletions
|
@ -9,7 +9,7 @@ describe("errors", () => {
|
|||
Reflect.construct(value);
|
||||
}).toThrowWithMessage(
|
||||
TypeError,
|
||||
"First argument of Reflect.construct() must be a function"
|
||||
"First argument of Reflect.construct() must be a constructor"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue