mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 03:29:49 +00:00
LibWeb: Provide file name to JavaScript interpreter
This commit is contained in:
parent
6172cb3599
commit
8dca96fb61
Notes:
sideshowbarker
2024-07-18 21:49:39 +09:00
Author: https://github.com/boricj
Commit: 8dca96fb61
Pull-request: https://github.com/SerenityOS/serenity/pull/5547
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg
4 changed files with 7 additions and 4 deletions
|
@ -546,9 +546,9 @@ JS::Interpreter& Document::interpreter()
|
|||
return *m_interpreter;
|
||||
}
|
||||
|
||||
JS::Value Document::run_javascript(const StringView& source)
|
||||
JS::Value Document::run_javascript(const StringView& source, const StringView& filename)
|
||||
{
|
||||
auto parser = JS::Parser(JS::Lexer(source));
|
||||
auto parser = JS::Parser(JS::Lexer(source, filename));
|
||||
auto program = parser.parse_program();
|
||||
if (parser.has_errors()) {
|
||||
parser.print_errors();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue