INNER CODE UNIT · JavaScript

enterFunction

standard-things/esm · .babel.config.js:70

  function enterFunction(path) {
    const { node } = path
    const { directives } = node.body

    if (directives &&
        isSimpleParameterList(node.params) &&
        ! isInMode(path)) {
      directives.push(types.directive(types.directiveLiteral("use strict")))
    }
  }

  return {
    visitor: {
      ArrowFunctionExpression: enterFunction,
      FunctionDeclaration: enterFunction,
      FunctionExpression: enterFunction
    }
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…