Sha256: 3f865f1879a4a230968c70d93ecbe32f460bdf87e90c5e6daae8f04e8d38b7f4

Contents?: true

Size: 992 Bytes

Versions: 3

Compression:

Stored size: 992 Bytes

Contents

"use strict";

exports.__esModule = true;
exports.Scope = Scope;
exports.VariableDeclaration = VariableDeclaration;

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } }

var _messages = require("../../../messages");

var messages = _interopRequireWildcard(_messages);

function Scope(node, parent, scope) {
  for (var name in scope.bindings) {
    var binding = scope.bindings[name];

    // not a constant
    if (binding.kind !== "const" && binding.kind !== "module") continue;

    var _arr = binding.constantViolations;
    for (var _i = 0; _i < _arr.length; _i++) {
      var violation = _arr[_i];
      throw violation.errorWithNode(messages.get("readOnly", name));
    }
  }
}

function VariableDeclaration(node) {
  if (node.kind === "const") node.kind = "let";
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/babel-core/lib/babel/transformation/transformers/es6/constants.js
gulp_assets-1.0.0.pre.4 template/node_modules/babel-core/lib/babel/transformation/transformers/es6/constants.js
gulp_assets-1.0.0.pre.3 template/node_modules/babel-core/lib/babel/transformation/transformers/es6/constants.js