Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Kling
20fb900937 LibJS+LibWeb: Move script parse time logging from JS::Script to LibWeb
Let's only log HTML::ClassicScript parse times for now. Otherwise things
will get excessively noisy in test-js and the test262 runner.
2021-09-14 21:41:51 +02:00
Andreas Kling
10c489713d LibJS+LibWeb: Let JS::Script::parse() return a list of errors (on error)
These are really supposed to be a list of SyntaxError objects, but for
now we simply return all the Parser::Error objects we got from Parser.
2021-09-14 21:41:51 +02:00
Andreas Kling
f08a46bd9e LibJS: Make JS::Script keep the VM alive
Script has a Handle member (m_realm), and for handles to remain valid,
the VM must stay alive.
2021-09-14 21:41:51 +02:00
Andreas Kling
3ca2e701e6 LibJS: Log scripts parsed by JS::Script::parse() and how long it took 2021-09-13 22:21:57 +02:00
Linus Groh
106f295916 LibJS+LibWeb: Make JS::Script and Web::HTML::ClassicScript use Realms
The spec wants Script Records to have a Realm, not a GlobalObject.
2021-09-12 15:18:25 +02:00
Andreas Kling
1484980f8f LibWeb+LibJS: Remember source filenames when using HTML::Script
It's a lot easier to debug JavaScript problems if you can see which file
the errors are in. :^)
2021-09-11 00:36:37 +02:00
Andreas Kling
d823d7da54 LibJS: Implement the ParseScript AO (as JS::Script::parse()) 2021-09-09 21:25:10 +02:00
Andreas Kling
612a23d6fc LibJS: Start adding a JS::Script class (spec's "Script Record") 2021-09-09 21:25:10 +02:00