LibJS: Stop tracking whether execution context is strict mode or not

This was only used for basic testing, and forced us to plumb this flag
flag in a bunch of places.
This commit is contained in:
Andreas Kling 2025-10-28 21:16:35 +01:00 committed by Andreas Kling
parent fb05063dde
commit fdb85a330e
Notes: github-actions[bot] 2025-10-29 20:22:21 +00:00
19 changed files with 4 additions and 320 deletions

View file

@ -25,18 +25,15 @@ Result<GC::Ref<Script>, Vector<ParserError>> Script::parse(StringView source_tex
if (parser.has_errors())
return parser.errors();
bool strict_mode = script->is_strict_mode();
// 3. Return Script Record { [[Realm]]: realm, [[ECMAScriptCode]]: script, [[HostDefined]]: hostDefined }.
return realm.heap().allocate<Script>(realm, filename, move(script), host_defined, strict_mode);
return realm.heap().allocate<Script>(realm, filename, move(script), host_defined);
}
Script::Script(Realm& realm, StringView filename, NonnullRefPtr<Program> parse_node, HostDefined* host_defined, bool strict_mode)
Script::Script(Realm& realm, StringView filename, NonnullRefPtr<Program> parse_node, HostDefined* host_defined)
: m_realm(realm)
, m_parse_node(move(parse_node))
, m_filename(filename)
, m_host_defined(host_defined)
, m_strict_mode(strict_mode)
{
}