mirror of https://github.com/vuejs/core.git
fix(codegen): ensure mapping is added only if node source is available
This commit is contained in:
parent
56be3dd4db
commit
5285fb6c22
|
@ -188,7 +188,9 @@ function createCodegenContext(
|
||||||
name = content
|
name = content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addMapping(node.loc.start, name)
|
if (node.loc.source) {
|
||||||
|
addMapping(node.loc.start, name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (newlineIndex === NewlineType.Unknown) {
|
if (newlineIndex === NewlineType.Unknown) {
|
||||||
// multiple newlines, full iteration
|
// multiple newlines, full iteration
|
||||||
|
@ -225,7 +227,7 @@ function createCodegenContext(
|
||||||
context.column = code.length - newlineIndex
|
context.column = code.length - newlineIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node && node.loc !== locStub) {
|
if (node && node.loc !== locStub && node.loc.source) {
|
||||||
addMapping(node.loc.end)
|
addMapping(node.loc.end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue