mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibWeb: Use inline script tag source line as javascript line offset
This makes JS exception line numbers meaningful for inline script tags.
This commit is contained in:
committed by
Andreas Kling
parent
47d0d9fd65
commit
c575710e5e
@@ -13,10 +13,10 @@
|
||||
namespace JS {
|
||||
|
||||
// 16.1.5 ParseScript ( sourceText, realm, hostDefined ), https://tc39.es/ecma262/#sec-parse-script
|
||||
Result<NonnullRefPtr<Script>, Vector<Parser::Error>> Script::parse(StringView source_text, Realm& realm, StringView filename, HostDefined* host_defined)
|
||||
Result<NonnullRefPtr<Script>, Vector<Parser::Error>> Script::parse(StringView source_text, Realm& realm, StringView filename, HostDefined* host_defined, size_t line_number_offset)
|
||||
{
|
||||
// 1. Let body be ParseText(sourceText, Script).
|
||||
auto parser = Parser(Lexer(source_text, filename));
|
||||
auto parser = Parser(Lexer(source_text, filename, line_number_offset));
|
||||
auto body = parser.parse_program();
|
||||
|
||||
// 2. If body is a List of errors, return body.
|
||||
|
||||
Reference in New Issue
Block a user