mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-26 05:42:07 +08:00
fix(validate): mock console object in validate step (#7358)
* feat(core): mock console object in boa engine context to suppress logs * style(core): update quote style in validate.rs
This commit is contained in:
@@ -244,6 +244,14 @@ impl CoreConfigValidator {
|
||||
use boa_engine::{Context, Source};
|
||||
|
||||
let mut context = Context::default();
|
||||
let _ = context.eval(Source::from_bytes(
|
||||
"var console = Object.freeze({
|
||||
log(...data){},
|
||||
info(...data){},
|
||||
error(...data){},
|
||||
debug(...data){},
|
||||
});",
|
||||
));
|
||||
let result = context.eval(Source::from_bytes(&content));
|
||||
|
||||
match result {
|
||||
|
||||
Reference in New Issue
Block a user