Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102354079
HarmonyTopLevelThisParserPlugin.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
Wed, Feb 19, 19:53
Size
715 B
Mime Type
text/x-c++
Expires
Fri, Feb 21, 19:53 (2 d)
Engine
blob
Format
Raw Data
Handle
24337027
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
HarmonyTopLevelThisParserPlugin.js
View Options
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Florent Cailhol @ooflorent
*/
"use strict";
const ConstDependency = require("./ConstDependency");
const HarmonyExports = require("./HarmonyExports");
class HarmonyTopLevelThisParserPlugin {
apply(parser) {
parser.hooks.expression
.for("this")
.tap("HarmonyTopLevelThisParserPlugin", node => {
if (!parser.scope.topLevelScope) return;
if (HarmonyExports.isEnabled(parser.state)) {
const dep = new ConstDependency("undefined", node.range, null);
dep.loc = node.loc;
parser.state.module.addPresentationalDependency(dep);
return this;
}
});
}
}
module.exports = HarmonyTopLevelThisParserPlugin;
Event Timeline
Log In to Comment