Skip to content

Commit

Permalink
📇: support optional loading of all deps for expression
Browse files Browse the repository at this point in the history
Expression deserialization is synchronous, but we sometimes still want to ensure that all modules the expression depends on are loaded.
  • Loading branch information
merryman authored and linusha committed Jul 23, 2024
1 parent 696d2d9 commit ae28ec2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lively.serializer2/plugins/expression-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ export default class ExpressionSerializer {
return m ? m.record().exports : {};
}

async ensureAllBindingsLoaded (exprObj) {
for (let binding in exprObj.bindings) {
await System.import(this.resolveModule(binding));
}
}

deserializeExprObj ({ __expr__: source, bindings }) {
const __boundValues__ = {};

Expand Down

0 comments on commit ae28ec2

Please sign in to comment.