mirror of
https://github.com/RustPython/Parser.git
synced 2025-09-06 18:40:54 +00:00
Remove incognito from vm
This commit is contained in:
parent
ed09df8223
commit
9ac8969e0d
1 changed files with 2 additions and 11 deletions
|
@ -39,17 +39,10 @@ pub struct CompileOpts {
|
||||||
/// How optimized the bytecode output should be; any optimize > 0 does
|
/// How optimized the bytecode output should be; any optimize > 0 does
|
||||||
/// not emit assert statements
|
/// not emit assert statements
|
||||||
pub optimize: u8,
|
pub optimize: u8,
|
||||||
/// Whether introspection on defined functions/other items should be allowed;
|
|
||||||
/// e.g. when true, `func.__globals__` throws an error (where func is a function defined
|
|
||||||
/// in an incognito context)
|
|
||||||
pub incognito: bool,
|
|
||||||
}
|
}
|
||||||
impl Default for CompileOpts {
|
impl Default for CompileOpts {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
CompileOpts {
|
CompileOpts { optimize: 0 }
|
||||||
optimize: 0,
|
|
||||||
incognito: false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,9 +181,7 @@ impl<O: OutputStream> Compiler<O> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn push_output(&mut self, mut code: CodeObject) {
|
fn push_output(&mut self, code: CodeObject) {
|
||||||
code.flags
|
|
||||||
.set(bytecode::CodeFlags::INCOGNITO, self.opts.incognito);
|
|
||||||
self.output_stack.push(code.into());
|
self.output_stack.push(code.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue