mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
correct scope handling for closures, this was broken after the change to not make calls open a scope.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1444 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -527,7 +527,8 @@ ScriptValueP ScriptClosure::dependencies(Context& ctx, const Dependency& dep) co
|
||||
}
|
||||
void ScriptClosure::applyBindings(Context& ctx) const {
|
||||
FOR_EACH_CONST(b, bindings) {
|
||||
if (ctx.getVariableScope(b.first) != 1) {
|
||||
if (ctx.getVariableScope(b.first) != 0) {
|
||||
// variables passed as arguments (i.e. in scope 0) override these default bindings
|
||||
ctx.setVariable(b.first, b.second);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user