fix: remove filename annotation in buildCodeFrameError (#10539)
This commit is contained in:
parent
1b19608a5a
commit
dcf7d89b8e
@ -259,8 +259,6 @@ export default class File {
|
|||||||
): Error {
|
): Error {
|
||||||
let loc = node && (node.loc || node._loc);
|
let loc = node && (node.loc || node._loc);
|
||||||
|
|
||||||
msg = `${this.opts.filename ?? "unknown"}: ${msg}`;
|
|
||||||
|
|
||||||
if (!loc && node) {
|
if (!loc && node) {
|
||||||
const state = {
|
const state = {
|
||||||
loc: null,
|
loc: null,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
var code = "function f() {}";
|
expect(() => {
|
||||||
transform(code, {
|
var code = "function f() {}";
|
||||||
|
transform(code, {
|
||||||
plugins: [
|
plugins: [
|
||||||
function() {
|
function() {
|
||||||
return {
|
return {
|
||||||
@ -13,4 +14,5 @@ transform(code, {
|
|||||||
],
|
],
|
||||||
// hard to assert on ANSI escape codes
|
// hard to assert on ANSI escape codes
|
||||||
highlightCode: false,
|
highlightCode: false,
|
||||||
});
|
});
|
||||||
|
}).toThrow(/^unknown: someMsg\s+> 1 \| function f\(\) {}/);
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"throws": "unknown: someMsg\n> 1 | function f() {}"
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user