1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibWeb: Provide file name to JavaScript interpreter

This commit is contained in:
Jean-Baptiste Boric 2021-02-27 19:35:45 +01:00 committed by Andreas Kling
parent 6172cb3599
commit 8dca96fb61
4 changed files with 7 additions and 4 deletions

View file

@ -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();