@eagleoutice/flowr-dev
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
19 lines • 806 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.overwriteEnvironment = overwriteEnvironment;
const scoping_1 = require("./scoping");
/**
* Definitions within `next` replace those in `base` by name; if all of `next`'s are maybe, they are appended instead (turning existing ones maybe too), like {@link appendEnvironment}.
* @see {@link Environment.overwrite} - for details on how definitions are handled.
*/
function overwriteEnvironment(base, next, applyCds) {
if (base === undefined || next === undefined) {
return next ?? base;
}
({ base, next } = (0, scoping_1.padToCommonScope)(base, next));
return {
current: base.current.overwrite(next.current, applyCds),
level: base.level
};
}
//# sourceMappingURL=overwrite.js.map