diff options
author | Marius Kintel <marius@kintel.net> | 2013-08-21 05:40:21 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-08-21 05:40:21 (GMT) |
commit | a7396cc36fbd2269bc75b0632e659dd05149259b (patch) | |
tree | 2dcf579cf06794a75b9bf6b90e270a1e6848e007 /src/module.cc | |
parent | fe7fb45019affbf683930d6368fe38524bdd2649 (diff) |
Fixes two problems related to : lookup was dynamic rather than lexical, assignment was done after all local variables causing it not to be copyable
Diffstat (limited to 'src/module.cc')
-rw-r--r-- | src/module.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/module.cc b/src/module.cc index 8fb8506..f66c8ef 100644 --- a/src/module.cc +++ b/src/module.cc @@ -180,8 +180,9 @@ AbstractNode *Module::instantiate(const Context *ctx, const ModuleInstantiation } ModuleContext c(ctx, evalctx); - c.initializeModule(*this); + // set $children first since we might have variables depending on it c.set_variable("$children", Value(double(inst->scope.children.size()))); + c.initializeModule(*this); // FIXME: Set document path to the path of the module #if 0 && DEBUG c.dump(this, inst); |