mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibJS: Make more use of Value::is and Value::as_if in JS runtime
This commit is contained in:
committed by
Shannon Booth
parent
cadba4c0e7
commit
d7e828a366
Notes:
github-actions[bot]
2026-02-27 16:20:55 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d7e828a3661 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8208 Reviewed-by: https://github.com/shannonbooth ✅
@@ -78,9 +78,7 @@ SharedFunctionInstanceData::SharedFunctionInstanceData(
|
||||
// and then reused in all subsequent function instantiations.
|
||||
|
||||
// 2. Let code be func.[[ECMAScriptCode]].
|
||||
ScopeNode const* scope_body = nullptr;
|
||||
if (is<ScopeNode>(*m_ecmascript_code))
|
||||
scope_body = static_cast<ScopeNode const*>(m_ecmascript_code.ptr());
|
||||
auto const* scope_body = as_if<ScopeNode>(*m_ecmascript_code);
|
||||
m_has_scope_body = scope_body != nullptr;
|
||||
|
||||
// 3. Let strict be func.[[Strict]].
|
||||
|
||||
Reference in New Issue
Block a user