Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82598288
FlagUsingEvalPlugin.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Sep 12, 08:30
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Sep 14, 08:30 (2 d)
Engine
blob
Format
Raw Data
Handle
20718346
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
FlagUsingEvalPlugin.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Sergey Melyukov @smelukov
*/
"use strict";
const InnerGraph = require("./optimize/InnerGraph");
/** @typedef {import("./Compiler")} Compiler */
class FlagUsingEvalPlugin {
/**
* Apply the plugin
* @param {Compiler} compiler the compiler instance
* @returns {void}
*/
apply(compiler) {
compiler.hooks.compilation.tap(
"FlagUsingEvalPlugin",
(compilation, { normalModuleFactory }) => {
const handler = parser => {
parser.hooks.call.for("eval").tap("FlagUsingEvalPlugin", () => {
parser.state.module.buildInfo.moduleConcatenationBailout = "eval()";
parser.state.module.buildInfo.usingEval = true;
InnerGraph.bailout(parser.state);
});
};
normalModuleFactory.hooks.parser
.for("javascript/auto")
.tap("FlagUsingEvalPlugin", handler);
normalModuleFactory.hooks.parser
.for("javascript/dynamic")
.tap("FlagUsingEvalPlugin", handler);
normalModuleFactory.hooks.parser
.for("javascript/esm")
.tap("FlagUsingEvalPlugin", handler);
}
);
}
}
module.exports = FlagUsingEvalPlugin;
Event Timeline
Log In to Comment