source: trip-planner-front/node_modules/webpack/lib/dependencies/HarmonyTopLevelThisParserPlugin.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 715 bytes
Line 
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Florent Cailhol @ooflorent
4*/
5
6"use strict";
7
8const ConstDependency = require("./ConstDependency");
9const HarmonyExports = require("./HarmonyExports");
10
11class HarmonyTopLevelThisParserPlugin {
12 apply(parser) {
13 parser.hooks.expression
14 .for("this")
15 .tap("HarmonyTopLevelThisParserPlugin", node => {
16 if (!parser.scope.topLevelScope) return;
17 if (HarmonyExports.isEnabled(parser.state)) {
18 const dep = new ConstDependency("undefined", node.range, null);
19 dep.loc = node.loc;
20 parser.state.module.addPresentationalDependency(dep);
21 return this;
22 }
23 });
24 }
25}
26
27module.exports = HarmonyTopLevelThisParserPlugin;
Note: See TracBrowser for help on using the repository browser.