Skip to content

Commit 905cefc

Browse files
authored
Expose more compile options through CompileOptionsWrapper (#714)
Added `set_muted_errors`, `set_is_run_once`, `set_no_script_rval` allowing Servo to follow Gecko's configuration. `isRunOnce` and `noScriptRval` are probably just some small optimizations. Testing: Not required, allows setting more `CompileOptions` Servo PR: [servo/43020](servo/servo#43020) Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
1 parent 994dacf commit 905cefc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

mozjs/src/rust.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,24 @@ impl CompileOptionsWrapper {
556556
(*self.ptr)._base.introductionType = introduction_type.as_ptr();
557557
}
558558
}
559+
560+
pub fn set_muted_errors(&mut self, muted_errors: bool) {
561+
unsafe {
562+
(*self.ptr)._base.mutedErrors_ = muted_errors;
563+
}
564+
}
565+
566+
pub fn set_is_run_once(&mut self, is_run_once: bool) {
567+
unsafe {
568+
(*self.ptr).isRunOnce = is_run_once;
569+
}
570+
}
571+
572+
pub fn set_no_script_rval(&mut self, no_script_rval: bool) {
573+
unsafe {
574+
(*self.ptr).noScriptRval = no_script_rval;
575+
}
576+
}
559577
}
560578

561579
impl Drop for CompileOptionsWrapper {

0 commit comments

Comments
 (0)