How to use the reify/lib/parser/babylon.js.parse function in reify

To help you get started, we’ve selected a few reify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github standard-things / esm / packages / babel-plugin-transform-es2015-modules-reify / index.js View on Github external
module.exports = function () {
  var compiler = require("reify/lib/compiler.js");
  var parse = require("reify/lib/parser/babylon.js").parse;
  var validators = require("babel-types/lib/validators");
  var ibs = validators.isBlockScoped;
  var t = require("babel-types");

  // Allow t.isBlockScoped to return true for import-related nodes.
  validators.isBlockScoped = function (node) {
    return node &&
      t.isImportDeclaration(node) ||
      ibs.apply(this, arguments);
  };

  function removeLiveBindingUpdateViolations(scope, opts) {
    Object.keys(scope.bindings).forEach(function (name) {
      var b = scope.bindings[name];
      if (b.kind === "module") {
        // Make the binding have a "let" or "var" kind from the