Socket
Socket
Sign inDemoInstall

@babel/core

Package Overview
Dependencies
Maintainers
4
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/core - npm Package Compare versions

Comparing version 8.0.0-alpha.6 to 8.0.0-alpha.7

2

lib/config/config-chain.js

@@ -350,3 +350,3 @@ import path from "path";

delete options.exclude;
if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {
if (Object.hasOwn(options, "sourceMap")) {
options.sourceMaps = options.sourceMap;

@@ -353,0 +353,0 @@ delete options.sourceMap;

@@ -203,3 +203,3 @@ import { isBrowsersQueryValid, TargetNames } from "@babel/helper-compilation-targets";

const subLoc = access(loc, key);
if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!Object.hasOwnProperty.call(TargetNames, key)) {
if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!Object.hasOwn(TargetNames, key)) {
const validTargets = Object.keys(TargetNames).join(", ");

@@ -206,0 +206,0 @@ throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`);

@@ -58,3 +58,3 @@ import removed from "./removed.js";

;
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "noUninitializedPrivateFieldAccess", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
export const assumptionsNames = new Set(knownAssumptions);

@@ -116,7 +116,4 @@ function getSource(loc) {

}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function assertNoDuplicateSourcemap(opts) {
if (has(opts, "sourceMap") && has(opts, "sourceMaps")) {
if (Object.hasOwn(opts, "sourceMap") && Object.hasOwn(opts, "sourceMaps")) {
throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");

@@ -123,0 +120,0 @@ }

;
export const version = "8.0.0-alpha.6";
export const version = "8.0.0-alpha.7";
export { default as File } from "./transformation/file/file.js";

@@ -4,0 +4,0 @@ export { default as buildExternalHelpers } from "./tools/build-external-helpers.js";

@@ -50,3 +50,3 @@ import { parse } from "@babel/parser";

if (missingPlugin) {
err.message = `${filename}: ` + generateMissingPluginMessage(missingPlugin[0], loc, codeFrame);
err.message = `${filename}: ` + generateMissingPluginMessage(missingPlugin[0], loc, codeFrame, filename);
} else {

@@ -53,0 +53,0 @@ err.message = `${filename}: ${err.message}\n\n` + codeFrame;

@@ -132,3 +132,3 @@ const pluginNameMap = {

}) => `${name} (${url})`;
export default function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {
export default function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;

@@ -153,2 +153,12 @@ const pluginInfo = pluginNameMap[missingPluginName];

}
const msgFilename = filename === "unknown" ? "<name of the input file>" : filename;
helpMessage += `
If you already added the plugin for this syntax to your config, it's possible that your config \
isn't being loaded.
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \
configuration:
\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
`;
return helpMessage;

@@ -155,0 +165,0 @@ }

@@ -70,5 +70,3 @@ import * as helpers from "@babel/helpers";

set(key, val) {
if (key === "helpersNamespace") {
throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'.");
}
;
this._map.set(key, val);

@@ -85,5 +83,2 @@ }

}
addImport() {
throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");
}
availableHelper(name, versionRange) {

@@ -99,3 +94,5 @@ let minVersion;

if (semver.valid(versionRange)) versionRange = `^${versionRange}`;
return !semver.intersects(`<${minVersion}`, versionRange) && !semver.intersects(`>=8.0.0`, versionRange);
{
return !semver.intersects(`<${minVersion}`, versionRange) && !semver.intersects(`>=9.0.0`, versionRange);
}
}

@@ -128,14 +125,10 @@ addHelper(name) {

});
this.path.unshiftContainer("body", nodes);
this.path.get("body").forEach(path => {
if (nodes.indexOf(path.node) === -1) return;
const added = this.path.unshiftContainer("body", nodes);
for (const path of added) {
if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);
});
}
return uid;
}
addTemplateObject() {
throw new Error("This function has been moved into the template literal transform itself.");
}
buildCodeFrameError(node, msg, _Error = SyntaxError) {
let loc = node && (node.loc || node._loc);
let loc = node?.loc;
if (!loc && node) {

@@ -171,3 +164,4 @@ const state = {

}
;
//# sourceMappingURL=file.js.map
{
"name": "@babel/core",
"version": "8.0.0-alpha.6",
"version": "8.0.0-alpha.7",
"description": "Babel compiler core.",

@@ -50,11 +50,11 @@ "main": "./lib/index.js",

"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^8.0.0-alpha.6",
"@babel/generator": "^8.0.0-alpha.6",
"@babel/helper-compilation-targets": "^8.0.0-alpha.6",
"@babel/helper-module-transforms": "^8.0.0-alpha.6",
"@babel/helpers": "^8.0.0-alpha.6",
"@babel/parser": "^8.0.0-alpha.6",
"@babel/template": "^8.0.0-alpha.6",
"@babel/traverse": "^8.0.0-alpha.6",
"@babel/types": "^8.0.0-alpha.6",
"@babel/code-frame": "^8.0.0-alpha.7",
"@babel/generator": "^8.0.0-alpha.7",
"@babel/helper-compilation-targets": "^8.0.0-alpha.7",
"@babel/helper-module-transforms": "^8.0.0-alpha.7",
"@babel/helpers": "^8.0.0-alpha.7",
"@babel/parser": "^8.0.0-alpha.7",
"@babel/template": "^8.0.0-alpha.7",
"@babel/traverse": "^8.0.0-alpha.7",
"@babel/types": "^8.0.0-alpha.7",
"convert-source-map": "^2.0.0",

@@ -67,8 +67,8 @@ "debug": "^4.1.0",

"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^8.0.0-alpha.6",
"@babel/plugin-syntax-flow": "^8.0.0-alpha.6",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.6",
"@babel/plugin-transform-modules-commonjs": "^8.0.0-alpha.6",
"@babel/preset-env": "^8.0.0-alpha.6",
"@babel/preset-typescript": "^8.0.0-alpha.6",
"@babel/helper-transform-fixture-test-runner": "^8.0.0-alpha.7",
"@babel/plugin-syntax-flow": "^8.0.0-alpha.7",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.7",
"@babel/plugin-transform-modules-commonjs": "^8.0.0-alpha.7",
"@babel/preset-env": "^8.0.0-alpha.7",
"@babel/preset-typescript": "^8.0.0-alpha.7",
"@jridgewell/trace-mapping": "^0.3.17",

@@ -75,0 +75,0 @@ "@types/convert-source-map": "^2.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc