Invert the inverted boolean

This commit is contained in:
coolreader18 committed 2019-09-28 00:41:41 -05:00
1 parent 499bf146bd
commit d0f7b5f347
3 files changed
+11 -5

No files matched your search

+7 -1
View File
@@ -53,7 +53,13 @@ bitflags! {
const HAS_DEFAULTS = 0x01;
const HAS_KW_ONLY_DEFAULTS = 0x02;
const HAS_ANNOTATIONS = 0x04;
const NO_NEW_LOCALS = 0x08;
const NEW_LOCALS = 0x08;
}
}
impl Default for FunctionOpArg {
fn default() -> Self {
Self::NEW_LOCALS
}
}
+3 -3
View File
@@ -672,7 +672,7 @@ impl<O: OutputStream> Compiler<O> {
));
self.enter_scope();
let mut flags = bytecode::FunctionOpArg::empty();
let mut flags = bytecode::FunctionOpArg::default();
if have_defaults {
flags |= bytecode::FunctionOpArg::HAS_DEFAULTS;
}
@@ -992,7 +992,7 @@ impl<O: OutputStream> Compiler<O> {
// Turn code object into function object:
self.emit(Instruction::MakeFunction {
flags: bytecode::FunctionOpArg::NO_NEW_LOCALS,
flags: bytecode::FunctionOpArg::default() & !bytecode::FunctionOpArg::NEW_LOCALS,
});
self.emit(Instruction::LoadConst {
@@ -1929,7 +1929,7 @@ impl<O: OutputStream> Compiler<O> {
// Turn code object into function object:
self.emit(Instruction::MakeFunction {
flags: bytecode::FunctionOpArg::empty(),
flags: bytecode::FunctionOpArg::default(),
});
// Evaluate iterated item:
+1 -1
View File
@@ -1058,7 +1058,7 @@ impl Frame {
scope,
defaults,
kw_only_defaults,
!flags.contains(bytecode::FunctionOpArg::NO_NEW_LOCALS),
flags.contains(bytecode::FunctionOpArg::NEW_LOCALS),
);
let name = qualified_name.as_str().split('.').next_back().unwrap();