mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
enhance: Add support for unsafe-eval
and wasm-unsafe-eval
(#32893)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
This commit is contained in:
parent
2cf207ddc8
commit
92866ab911
51 changed files with 755 additions and 73 deletions
|
@ -442,7 +442,12 @@ impl JsTimers {
|
|||
) -> i32 {
|
||||
let callback = match callback {
|
||||
TimerCallback::StringTimerCallback(code_str) => {
|
||||
InternalTimerCallback::StringTimerCallback(code_str)
|
||||
let cx = GlobalScope::get_cx();
|
||||
if global.is_js_evaluation_allowed(cx) {
|
||||
InternalTimerCallback::StringTimerCallback(code_str)
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
TimerCallback::FunctionTimerCallback(function) => {
|
||||
// This is a bit complicated, but this ensures that the vector's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue