提交 6bc41845 编写于 作者: fxy060608's avatar fxy060608

wip(uts): compiler

上级 0c43e2b6
......@@ -70,18 +70,17 @@ export async function runKotlinProd(
}
const inputDir = process.env.UNI_INPUT_DIR
const outputDir = process.env.UNI_OUTPUT_DIR
let res = await compile(filename, {
const result = await compile(filename, {
inputDir,
outputDir,
sourceMap: true,
components,
})
if (!res) {
if (!result) {
return
}
if (res.error) {
console.error(parseUTSSyntaxError(res.error, inputDir))
return
if (result.error) {
throw parseUTSSyntaxError(result.error, inputDir)
}
genUTSPlatformResource(filename, {
inputDir,
......@@ -118,8 +117,7 @@ export async function runKotlinDev(
return
}
if (result.error) {
console.error(parseUTSSyntaxError(result.error, inputDir))
return
throw parseUTSSyntaxError(result.error, inputDir)
}
result.type = 'kotlin'
result.changed = []
......
......@@ -43,18 +43,17 @@ export async function runSwiftProd(
}
const inputDir = process.env.UNI_INPUT_DIR
const outputDir = process.env.UNI_OUTPUT_DIR
const res = await compile(filename, {
const result = await compile(filename, {
inputDir,
outputDir,
sourceMap: true,
components,
})
if (!res) {
if (!result) {
return
}
if (res.error) {
console.error(parseUTSSyntaxError(res.error, inputDir))
return
if (result.error) {
throw parseUTSSyntaxError(result.error, inputDir)
}
genUTSPlatformResource(filename, {
inputDir,
......@@ -113,8 +112,7 @@ export async function runSwiftDev(
return
}
if (result.error) {
console.error(parseUTSSyntaxError(result.error, inputDir))
return
throw parseUTSSyntaxError(result.error, inputDir)
}
result.type = 'swift'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册