Type Alias Config<param>

Config<param>: {
    digest: Digest<param>;
    global_declarative_record: "builtin" | "emulate";
}

Configuration object for transpile.

Type Parameters

  • param extends {
        FilePath?: unknown;
        NodeHash?: string | number;
    } = {}

Type declaration

  • digest: Digest<param>

    Hashing functions for nodes in file.root.

    (node, node_path, file_path, node_kind) => file_path + "#" + node_path

  • global_declarative_record: "builtin" | "emulate"

    Indicates whether the global declarative record should be emulated or not. NB: The global declarative record is a scope frame that sits right before the global object. For instance, in script code (not eval code nor module code): let x = 123 will cause the creation of a binding in the global declarative record and not in the global object. Unfortunately, this record cannot be accessed inside the language and we are stuck with two imperfect options:

    • "builtin": The builtin global declarative record is used, access to global variables will happen via parameter functions such as: scope.read, scope.writeSloppy, etc... Tracking values through these calls requires additional logic.
    • "emulate": A plain object is used to emulate the global declarative record. That means that instrumented code will never access the builtin global declarative record. Hence, every single bit of code should be instrumented which might be a hard requirement to meet.

    "builtin"