Socket
Socket
Sign inDemoInstall

babel-core

Package Overview
Dependencies
51
Maintainers
6
Versions
257
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.5.2 to 6.6.0

lib/transformation/file/options/removed.js

1

lib/api/browser.js

@@ -0,1 +1,2 @@

/* eslint max-len: 0 */
/* eslint no-new-func: 0 */

@@ -2,0 +3,0 @@

@@ -10,2 +10,3 @@ "use strict";

exports.__esModule = true;
exports.Plugin = Plugin;
exports.transformFile = transformFile;

@@ -76,2 +77,7 @@ exports.transformFileSync = transformFileSync;

exports.OptionManager = _transformationFileOptionsOptionManager2["default"];
function Plugin(alias) {
throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
}
exports.Pipeline = _transformationPipeline2["default"];

@@ -78,0 +84,0 @@

4

lib/helpers/merge.js

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -15,3 +13,3 @@

exports["default"] = function (dest /*:: ?: Object*/, src /*:: ?: Object*/) /*: ?Object*/ {
exports["default"] = function (dest, src) {
if (!dest || !src) return;

@@ -18,0 +16,0 @@

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -19,3 +17,3 @@

exports["default"] = function (ast /*: Object*/, comments /*:: ?: Array<Object>*/, tokens /*:: ?: Array<Object>*/) {
exports["default"] = function (ast, comments, tokens) {
if (ast) {

@@ -22,0 +20,0 @@ if (ast.type === "Program") {

@@ -0,1 +1,3 @@

/* eslint max-len: 0 */
"use strict";

@@ -2,0 +4,0 @@

@@ -1,5 +0,2 @@

/* @noflow */
/* global BabelParserOptions */
/* global BabelFileMetadata */
/* global BabelFileResult */
/* eslint max-len: 0 */

@@ -98,4 +95,2 @@ "use strict";

/*:: import type Pipeline from "../pipeline";*/
var INTERNAL_PLUGINS = [[_internalPluginsBlockHoist2["default"]], [_internalPluginsShadowFunctions2["default"]]];

@@ -116,3 +111,3 @@

function File(opts /*: Object*/, pipeline /*: Pipeline*/) {
function File(opts, pipeline) {
// istanbul ignore next

@@ -188,3 +183,3 @@

var has = false;
for (var _iterator = (this.ast.program.body /*: Array<Object>*/), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _getIterator(_iterator);;) {
var _ref;

@@ -257,3 +252,3 @@

var plugins /*: Array<[PluginPass, Object]>*/ = opts.plugins.concat(INTERNAL_PLUGINS);
var plugins = opts.plugins.concat(INTERNAL_PLUGINS);
var currentPluginVisitors = [];

@@ -292,3 +287,3 @@ var currentPluginPasses = [];

File.prototype.getModuleName = function getModuleName() /*: ?string*/ {
File.prototype.getModuleName = function getModuleName() {
var opts = this.opts;

@@ -337,3 +332,3 @@ if (!opts.moduleIds) {

File.prototype.resolveModuleSource = function resolveModuleSource(source /*: string*/) /*: string*/ {
File.prototype.resolveModuleSource = function resolveModuleSource(source) {
var resolveModuleSource = this.opts.resolveModuleSource;

@@ -344,4 +339,4 @@ if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename);

File.prototype.addImport = function addImport(source /*: string*/, imported /*: string*/) /*: Object*/ {
var name /*:: ?: string*/ = arguments.length <= 2 || arguments[2] === undefined ? imported : arguments[2];
File.prototype.addImport = function addImport(source, imported) {
var name = arguments.length <= 2 || arguments[2] === undefined ? imported : arguments[2];
return (function () {

@@ -375,3 +370,3 @@ var alias = source + ":" + imported;

File.prototype.addHelper = function addHelper(name /*: string*/) /*: Object*/ {
File.prototype.addHelper = function addHelper(name) {
var declar = this.declarations[name];

@@ -415,3 +410,3 @@ if (declar) return declar;

File.prototype.addTemplateObject = function addTemplateObject(helperName /*: string*/, strings /*: Array<Object>*/, raw /*: Object*/) /*: Object*/ {
File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) {
// Generate a unique name based on the string literals so we dedupe

@@ -440,4 +435,4 @@ // identical strings used in the program.

File.prototype.buildCodeFrameError = function buildCodeFrameError(node /*: Object*/, msg /*: string*/) /*: Error*/ {
var Error /*: typeof Error*/ = arguments.length <= 2 || arguments[2] === undefined ? SyntaxError : arguments[2];
File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) {
var Error = arguments.length <= 2 || arguments[2] === undefined ? SyntaxError : arguments[2];

@@ -465,3 +460,3 @@ var loc = node && (node.loc || node._loc);

File.prototype.mergeSourceMap = function mergeSourceMap(map /*: Object*/) {
File.prototype.mergeSourceMap = function mergeSourceMap(map) {
var inputMap = this.opts.inputSourceMap;

@@ -517,3 +512,3 @@

File.prototype.parse = function parse(code /*: string*/) {
File.prototype.parse = function parse(code) {
this.log.debug("Parse start");

@@ -544,3 +539,3 @@ var ast = _babylon.parse(code, this.parserOpts);

File.prototype.transform = function transform() /*: BabelFileResult*/ {
File.prototype.transform = function transform() {
// istanbul ignore next

@@ -563,3 +558,3 @@

File.prototype.wrap = function wrap(code /*: string*/, callback /*: Function*/) /*: BabelFileResult*/ {
File.prototype.wrap = function wrap(code, callback) {
code = code + "";

@@ -603,3 +598,3 @@

File.prototype.addCode = function addCode(code /*: string*/) {
File.prototype.addCode = function addCode(code) {
code = (code || "") + "";

@@ -621,3 +616,3 @@ code = this.parseInputSourceMap(code);

File.prototype.call = function call(key /*: "pre" | "post"*/, pluginPasses /*: Array<PluginPass>*/) {
File.prototype.call = function call(key, pluginPasses) {
for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3);;) {

@@ -643,3 +638,3 @@ var _ref3;

File.prototype.parseInputSourceMap = function parseInputSourceMap(code /*: string*/) /*: string*/ {
File.prototype.parseInputSourceMap = function parseInputSourceMap(code) {
var opts = this.opts;

@@ -666,3 +661,3 @@

File.prototype.makeResult = function makeResult(_ref4 /*: BabelFileResult*/) /*: BabelFileResult*/ {
File.prototype.makeResult = function makeResult(_ref4) {
var code = _ref4.code;

@@ -697,7 +692,7 @@ var map = _ref4.map;

File.prototype.generate = function generate() /*: BabelFileResult*/ {
File.prototype.generate = function generate() {
var opts = this.opts;
var ast = this.ast;
var result /*: BabelFileResult*/ = { ast: ast };
var result = { ast: ast };
if (!opts.code) return this.makeResult(result);

@@ -704,0 +699,0 @@

@@ -0,1 +1,3 @@

/* eslint max-len: 0 */
"use strict";

@@ -2,0 +4,0 @@

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -22,4 +20,4 @@

function normaliseOptions() /*: Object*/ {
var options /*: Object*/ = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
function normaliseOptions() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

@@ -26,0 +24,0 @@ for (var key in options) {

@@ -0,1 +1,3 @@

/* eslint max-len: 0 */
"use strict";

@@ -61,2 +63,6 @@

var _removed = require("./removed");
var _removed2 = _interopRequireDefault(_removed);
var _path = require("path");

@@ -290,3 +296,9 @@

if (!option && this.log) {
this.log.error("Unknown option: " + alias + "." + _key2, ReferenceError);
var pluginOptsInfo = "Check out http://babeljs.io/docs/usage/options/ for more info";
if (_removed2["default"][_key2]) {
this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2["default"][_key2].message, ReferenceError);
} else {
this.log.error("Unknown option: " + alias + "." + _key2 + ". " + pluginOptsInfo, ReferenceError);
}
}

@@ -293,0 +305,0 @@ }

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -26,12 +24,12 @@

function boolean(val /*: any*/) /*: boolean*/ {
function boolean(val) {
return !!val;
}
function booleanString(val /*: any*/) /*: boolean | any*/ {
function booleanString(val) {
return util.booleanify(val);
}
function list(val /*: any*/) /*: Array<string>*/ {
function list(val) {
return util.list(val);
}

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -4,0 +2,0 @@

@@ -1,5 +0,1 @@

/* @flow */
/* global BabelFileResult */
/* global BabelFileMetadata */
"use strict";

@@ -30,4 +26,4 @@

Pipeline.prototype.lint = function lint(code /*: string*/) /*: BabelFileResult*/ {
var opts /*:: ?: Object*/ = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
Pipeline.prototype.lint = function lint(code) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

@@ -39,3 +35,3 @@ opts.code = false;

Pipeline.prototype.pretransform = function pretransform(code /*: string*/, opts /*:: ?: Object*/) /*: BabelFileResult*/ {
Pipeline.prototype.pretransform = function pretransform(code, opts) {
var file = new _file2["default"](opts, this);

@@ -49,3 +45,3 @@ return file.wrap(code, function () {

Pipeline.prototype.transform = function transform(code /*: string*/, opts /*:: ?: Object*/) /*: BabelFileResult*/ {
Pipeline.prototype.transform = function transform(code, opts) {
var file = new _file2["default"](opts, this);

@@ -59,3 +55,3 @@ return file.wrap(code, function () {

Pipeline.prototype.analyse = function analyse(code /*: string*/, opts /*: Object*/, visitor /*:: ?: Object*/) /*: ?BabelFileMetadata*/ {
Pipeline.prototype.analyse = function analyse(code, opts, visitor) {
if (opts === undefined) opts = {};

@@ -71,3 +67,3 @@

Pipeline.prototype.transformFromAst = function transformFromAst(ast /*: Object*/, code /*: string*/, opts /*: Object*/) /*: BabelFileResult*/ {
Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) {
ast = _helpersNormalizeAst2["default"](ast);

@@ -74,0 +70,0 @@

@@ -1,2 +0,2 @@

/* @noflow */
/* eslint max-len: 0 */

@@ -46,3 +46,3 @@ "use strict";

function Plugin(plugin /*: Object*/, key /*:: ?: string*/) {
function Plugin(plugin, key) {
_classCallCheck(this, Plugin);

@@ -72,3 +72,3 @@

var fns /*: Array<?Function>*/ = [target[key], this[key]];
var fns = [target[key], this[key]];

@@ -105,3 +105,3 @@ return function () {

Plugin.prototype.maybeInherit = function maybeInherit(loc /*: string*/) {
Plugin.prototype.maybeInherit = function maybeInherit(loc) {
var inherits = this.take("inherits");

@@ -123,3 +123,3 @@ if (!inherits) return;

Plugin.prototype.init = function init(loc /*: string*/, i /*: number*/) {
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;

@@ -135,3 +135,3 @@ this.initialized = true;

Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor /*: Object*/) /*: Object*/ {
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2);;) {

@@ -138,0 +138,0 @@ var _ref2;

@@ -1,3 +0,1 @@

/* @flow */
"use strict";

@@ -62,3 +60,3 @@

function canCompile(filename /*: string*/, altExts /*:: ?: Array<string>*/) /*: boolean*/ {
function canCompile(filename, altExts) {
var exts = altExts || canCompile.EXTENSIONS;

@@ -79,3 +77,3 @@ var ext = _path2["default"].extname(filename);

function list(val /*:: ?: string*/) /*: Array<string>*/ {
function list(val) {
if (!val) {

@@ -96,3 +94,3 @@ return [];

function regexify(val /*: any*/) /*: RegExp*/ {
function regexify(val) {
if (!val) {

@@ -129,3 +127,3 @@ return new RegExp(/.^/);

function arrayify(val /*: any*/, mapFn /*:: ?: Function*/) /*: Array<any>*/ {
function arrayify(val, mapFn) {
if (!val) return [];

@@ -147,3 +145,3 @@ if (_lodashLangIsBoolean2["default"](val)) return arrayify([val], mapFn);

function booleanify(val /*: any*/) /*: boolean | any*/ {
function booleanify(val) {
if (val === "true" || val == 1) {

@@ -164,3 +162,3 @@ return true;

function shouldIgnore(filename /*: string*/, ignore /*: Array<RegExp | Function>*/, only /*:: ?: Array<RegExp | Function>*/) /*: boolean*/ {
function shouldIgnore(filename, ignore, only) {
if (ignore === undefined) ignore = [];

@@ -215,3 +213,3 @@

function _shouldIgnore(pattern /*: Function | RegExp*/, filename /*: string*/) {
function _shouldIgnore(pattern, filename) {
if (typeof pattern === "function") {

@@ -218,0 +216,0 @@ return pattern(filename);

{
"name": "babel-core",
"version": "6.5.2",
"version": "6.6.0",
"description": "Babel compiler core.",

@@ -27,12 +27,12 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"dependencies": {
"babel-code-frame": "^6.3.13",
"babel-generator": "^6.4.5",
"babel-helpers": "^6.4.5",
"babel-messages": "^6.3.13",
"babel-template": "^6.3.13",
"babel-code-frame": "^6.6.0",
"babel-generator": "^6.6.0",
"babel-helpers": "^6.6.0",
"babel-messages": "^6.6.0",
"babel-template": "^6.6.0",
"babel-runtime": "^5.0.0",
"babel-register": "^6.5.2",
"babel-traverse": "^6.4.5",
"babel-types": "^6.5.2",
"babylon": "^6.5.2",
"babel-register": "^6.6.0",
"babel-traverse": "^6.6.0",
"babel-types": "^6.6.0",
"babylon": "^6.6.0",
"convert-source-map": "^1.1.0",

@@ -53,4 +53,4 @@ "debug": "^2.1.1",

"babel-helper-transform-fixture-test-runner": "^6.3.13",
"babel-polyfill": "^6.3.13"
"babel-polyfill": "^6.6.0"
}
}

@@ -0,2 +1,3 @@

/* eslint max-len: 0 */
// TODO: eventually deprecate this console.trace("use the `babel-register` package instead of `babel-core/register`");
module.exports = require("babel-register");
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc