403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /inetpub/wwwroot/parsmega.nuxt/node_modules/hard-source-webpack-plugin/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /inetpub/wwwroot/parsmega.nuxt/node_modules/hard-source-webpack-plugin/lib/TransformParserPlugin.js
const relateContext = require('./util/relate-context');
const pluginCompat = require('./util/plugin-compat');

const ParserSchemas3 = [['Parser', 'options']];
const ParserSchemas4 = [
  ['JsonParser', 'options'],
  ['Parser', 'options', 'sourceType'],
  ['WebAssemblyParser', 'options'],
];

try {
  ParserSchemas3[0].Parser = require('webpack/lib/Parser');
} catch (_) {}

try {
  ParserSchemas4[0].Parser = require('webpack/lib/JsonParser');
  ParserSchemas4[1].Parser = require('webpack/lib/Parser');
  try {
    ParserSchemas4[2].Parser = require('webpack/lib/WebAssemblyParser');
  } catch (_) {
    ParserSchemas4[2].Parser = require('webpack/lib/wasm/WebAssemblyParser');
  }
} catch (_) {}

const freezeArgument = {};

const thawArgument = {};

function freezeParser(parser, extra, methods) {
  const schemas = extra.schemas;
  for (let i = 0; i < schemas.length; i++) {
    if (parser.constructor === schemas[i].Parser) {
      const frozen = {
        type: schemas[i][0],
      };
      for (let j = 1; j < schemas[i].length; j++) {
        let arg = parser[schemas[i][j]];
        if (freezeArgument[schemas[i][j]]) {
          arg = freezeArgument[schemas[i][j]](arg, parser, extra, methods);
        }
        frozen[schemas[i][j]] = arg;
      }
      return frozen;
    }
  }
}

function thawParser(frozen, extra, methods) {
  const schemas = extra.schemas;
  for (let i = 0; i < schemas.length; i++) {
    if (frozen.type === schemas[i][0]) {
      const Parser = schemas[i].Parser;
      const args = [];
      for (let j = 1; j < schemas[i].length; j++) {
        let arg = frozen[schemas[i][j]];
        if (thawArgument[schemas[i][j]]) {
          arg = thawArgument[schemas[i][j]](arg, frozen, extra, methods);
        }
        args.push(arg);
      }
      try {
        return new Parser(...args);
      } catch (_) {
        return new (Function.prototype.bind.apply(
          Parser,
          [null].concat(args),
        ))();
      }
    }
  }
}

class TransformParserPlugin {
  constructor(options) {
    this.options = options || {};
  }

  apply(compiler) {
    const schema = this.options.schema;
    let schemas = ParserSchemas4;
    if (schema < 4) {
      schemas = ParserSchemas3;
    }

    pluginCompat.register(
      compiler,
      '_hardSourceBeforeFreezeParser',
      'syncWaterfall',
      ['frozen', 'item', 'extra'],
    );
    pluginCompat.register(
      compiler,
      '_hardSourceFreezeParser',
      'syncWaterfall',
      ['frozen', 'item', 'extra'],
    );
    pluginCompat.register(
      compiler,
      '_hardSourceAfterFreezeParser',
      'syncWaterfall',
      ['frozen', 'item', 'extra'],
    );

    pluginCompat.register(
      compiler,
      '_hardSourceBeforeThawParser',
      'syncWaterfall',
      ['item', 'frozen', 'extra'],
    );
    pluginCompat.register(compiler, '_hardSourceThawParser', 'syncWaterfall', [
      'item',
      'frozen',
      'extra',
    ]);
    pluginCompat.register(
      compiler,
      '_hardSourceAfterThawParser',
      'syncWaterfall',
      ['item', 'frozen', 'extra'],
    );

    let methods;

    pluginCompat.tap(
      compiler,
      '_hardSourceMethods',
      'TransformParserPlugin',
      _methods => {
        methods = _methods;
      },
    );

    pluginCompat.tap(
      compiler,
      '_hardSourceFreezeParser',
      'TransformParserPlugin freeze',
      (frozen, parser, extra) => {
        extra.schemas = schemas;
        frozen = freezeParser(parser, extra, methods);
        if (schema === 4) {
          frozen.moduleType = extra.module.type;
        }
        return frozen;
      },
    );

    pluginCompat.tap(
      compiler,
      '_hardSourceThawParser',
      'TransformParserPlugin thaw',
      (parser, { options, moduleType }, { normalModuleFactory }) => {
        if (schema < 4) {
          return normalModuleFactory.getParser(options);
        } else {
          return normalModuleFactory.getParser(moduleType, options);
        }
      },
    );
  }
}

module.exports = TransformParserPlugin;

Youez - 2016 - github.com/yon3zu
LinuXploit