Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121315853
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, Jul 10, 00:55
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Jul 12, 00:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27309729
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