mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
util: Set the experimental_enabled flag when options are set
This commit is contained in:
parent
f8bbc0a974
commit
df9c132551
3 changed files with 4 additions and 3 deletions
|
@ -406,6 +406,9 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
|
|||
|
||||
static mut EXPERIMENTAL_ENABLED: bool = false;
|
||||
|
||||
/// Turn on experimental features globally. Normally this is done
|
||||
/// during initialization by `set` or `from_cmdline_args`, but
|
||||
/// tests that require experimental features will also set it.
|
||||
pub fn set_experimental_enabled(new_value: bool) {
|
||||
unsafe {
|
||||
EXPERIMENTAL_ENABLED = new_value;
|
||||
|
@ -426,6 +429,7 @@ static mut OPTIONS: *mut Opts = 0 as *mut Opts;
|
|||
pub fn set(opts: Opts) {
|
||||
unsafe {
|
||||
assert!(OPTIONS.is_null());
|
||||
set_experimental_enabled(opts.enable_experimental);
|
||||
let box_opts = box opts;
|
||||
OPTIONS = mem::transmute(box_opts);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue