mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
614abcdeea
commit
c20d16d4f6
@ -92,7 +92,9 @@ __NEXT_STEP:;
|
|||||||
int argc = decl->args.size();
|
int argc = decl->args.size();
|
||||||
PyObject* obj;
|
PyObject* obj;
|
||||||
if(decl->nested){
|
if(decl->nested){
|
||||||
obj = VAR(Function({decl, is_simple, argc, frame->_module, frame->_locals.to_namedict()}));
|
NameDict_ captured = frame->_locals.to_namedict();
|
||||||
|
obj = VAR(Function({decl, is_simple, argc, frame->_module, captured}));
|
||||||
|
captured->set(decl->code->name, obj);
|
||||||
}else{
|
}else{
|
||||||
obj = VAR(Function({decl, is_simple, argc, frame->_module}));
|
obj = VAR(Function({decl, is_simple, argc, frame->_module}));
|
||||||
}
|
}
|
||||||
@ -110,7 +112,7 @@ __NEXT_STEP:;
|
|||||||
heap._auto_collect();
|
heap._auto_collect();
|
||||||
_name = StrName(byte.arg);
|
_name = StrName(byte.arg);
|
||||||
_0 = frame->_locals.try_get(_name);
|
_0 = frame->_locals.try_get(_name);
|
||||||
if(_0 != PY_NULL) { PUSH(_0); DISPATCH(); }
|
if(_0 != nullptr) { PUSH(_0); DISPATCH(); }
|
||||||
_0 = frame->f_closure_try_get(_name);
|
_0 = frame->f_closure_try_get(_name);
|
||||||
if(_0 != nullptr) { PUSH(_0); DISPATCH(); }
|
if(_0 != nullptr) { PUSH(_0); DISPATCH(); }
|
||||||
_0 = frame->f_globals().try_get(_name);
|
_0 = frame->f_globals().try_get(_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user