@babel/core
Advanced tools
Comparing version 7.6.2 to 7.6.3
@@ -205,3 +205,4 @@ "use strict"; | ||
if (nameMap.has(item.name)) { | ||
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`].join("\n")); | ||
const conflicts = items.filter(i => i.value === item.value); | ||
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n")); | ||
} | ||
@@ -208,0 +209,0 @@ |
@@ -236,4 +236,6 @@ "use strict"; | ||
buildCodeFrameError(node, msg, Error = SyntaxError) { | ||
var _this$opts$filename; | ||
let loc = node && (node.loc || node._loc); | ||
msg = `${this.opts.filename}: ${msg}`; | ||
msg = `${(_this$opts$filename = this.opts.filename) !== null && _this$opts$filename !== void 0 ? _this$opts$filename : "unknown"}: ${msg}`; | ||
@@ -240,0 +242,0 @@ if (!loc && node) { |
@@ -62,3 +62,3 @@ "use strict"; | ||
if (typeof result.then === "function") { | ||
throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); | ||
throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); | ||
} | ||
@@ -65,0 +65,0 @@ } else { |
@@ -45,8 +45,39 @@ "use strict"; | ||
const file = (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast); | ||
transformFile(file, config.passes); | ||
const opts = file.opts; | ||
const { | ||
outputCode, | ||
outputMap | ||
} = opts.code !== false ? (0, _generate.default)(config.passes, file) : {}; | ||
try { | ||
transformFile(file, config.passes); | ||
} catch (e) { | ||
var _opts$filename; | ||
e.message = `${(_opts$filename = opts.filename) !== null && _opts$filename !== void 0 ? _opts$filename : "unknown"}: ${e.message}`; | ||
if (!e.code) { | ||
e.code = "BABEL_TRANSFORM_ERROR"; | ||
} | ||
throw e; | ||
} | ||
let outputCode, outputMap; | ||
try { | ||
if (opts.code !== false) { | ||
({ | ||
outputCode, | ||
outputMap | ||
} = (0, _generate.default)(config.passes, file)); | ||
} | ||
} catch (e) { | ||
var _opts$filename2; | ||
e.message = `${(_opts$filename2 = opts.filename) !== null && _opts$filename2 !== void 0 ? _opts$filename2 : "unknown"}: ${e.message}`; | ||
if (!e.code) { | ||
e.code = "BABEL_GENERATE_ERROR"; | ||
} | ||
throw e; | ||
} | ||
return { | ||
@@ -53,0 +84,0 @@ metadata: file.metadata, |
@@ -171,3 +171,3 @@ "use strict"; | ||
if (typeof results[0].then === "function") { | ||
throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); | ||
throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); | ||
} | ||
@@ -174,0 +174,0 @@ |
{ | ||
"name": "@babel/core", | ||
"version": "7.6.2", | ||
"version": "7.6.3", | ||
"description": "Babel compiler core.", | ||
@@ -37,8 +37,8 @@ "main": "lib/index.js", | ||
"@babel/code-frame": "^7.5.5", | ||
"@babel/generator": "^7.6.2", | ||
"@babel/generator": "^7.6.3", | ||
"@babel/helpers": "^7.6.2", | ||
"@babel/parser": "^7.6.2", | ||
"@babel/parser": "^7.6.3", | ||
"@babel/template": "^7.6.0", | ||
"@babel/traverse": "^7.6.2", | ||
"@babel/types": "^7.6.0", | ||
"@babel/traverse": "^7.6.3", | ||
"@babel/types": "^7.6.3", | ||
"convert-source-map": "^1.1.0", | ||
@@ -50,8 +50,8 @@ "debug": "^4.1.0", | ||
"semver": "^5.4.1", | ||
"source-map": "^0.5.0" | ||
"source-map": "^0.6.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/helper-transform-fixture-test-runner": "^7.6.0" | ||
"@babel/helper-transform-fixture-test-runner": "^7.6.3" | ||
}, | ||
"gitHead": "b9cb4af953afb1a5aeed9b18526192ab15bb45c1" | ||
"gitHead": "d329156ebc17da01382acb83e212cb4328534ebc" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137954
4033
+ Addedsource-map@0.6.1(transitive)
- Removedsource-map@0.5.7(transitive)
Updated@babel/generator@^7.6.3
Updated@babel/parser@^7.6.3
Updated@babel/traverse@^7.6.3
Updated@babel/types@^7.6.3
Updatedsource-map@^0.6.1