time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

context.js (497B)


      1 import { Stack } from "./stack.js";
      2 import { FrameStack, topFrameName } from "./frameStack.js";
      3 import { evaluate } from "./index.js";
      4 export function createContext(environment) {
      5     return {
      6         stack: Stack.make(),
      7         environment,
      8         frameStack: FrameStack.make(),
      9         evaluate,
     10         inFunction: undefined,
     11     };
     12 }
     13 export function currentFunctionName(t) {
     14     return t.inFunction === undefined ? topFrameName : t.inFunction.getName();
     15 }
     16 //# sourceMappingURL=context.js.map