File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Libraries/LibWeb/Bindings Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,10 @@ void initialize_main_thread_vm(AgentType type)
125125 };
126126
127127 // 8.1.6.3 HostGetCodeForEval(argument), https://html.spec.whatwg.org/multipage/webappapis.html#hostgetcodeforeval(argument)
128- s_main_thread_vm->host_get_code_for_eval = [](JS::Object const &) -> GC::Ptr<JS::PrimitiveString> {
129- // FIXME: 1. If argument is a TrustedScript object, then return argument's data.
128+ s_main_thread_vm->host_get_code_for_eval = [](JS::Object const & argument) -> GC::Ptr<JS::PrimitiveString> {
129+ // 1. If argument is a TrustedScript object, then return argument's data.
130+ if (auto const * trusted_script = as_if<TrustedTypes::TrustedScript>(argument); trusted_script)
131+ return JS::PrimitiveString::create (argument.vm (), trusted_script->to_string ());
130132
131133 // 2. Otherwise, return no-code.
132134 return {};
You can’t perform that action at this time.
0 commit comments