cloneForContext method

JSInterpreter cloneForContext(
  1. Scope scope,
  2. Context ctx,
  3. bool inheritContexts
)

Implementation

JSInterpreter cloneForContext(
    Scope scope, Context ctx, bool inheritContexts) {
  JSInterpreter i = JSInterpreter(
      this.code, this.program, getContextForScope(this.program));
  if (inheritContexts) {
    contexts.keys.forEach((key) {
      i.contexts[key] = contexts[key]!;
    });
  }
  i.contexts[scope] = ctx;
  return i;
}