mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: add prop suffix name in the error message
Without this, you only get the following error: ``` UncaughtPromiseError > OwlError Uncaught promise > Invalid prop suffix OwlError: Invalid prop suffix ``` Which is not helping much to find the problematic code.
This commit is contained in:
committed by
Sam Degueldre
parent
17f4823b13
commit
9b656fd9e4
@@ -1156,7 +1156,7 @@ export class CodeGenerator {
|
|||||||
case "translate":
|
case "translate":
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new OwlError("Invalid prop suffix");
|
throw new OwlError(`Invalid prop suffix: ${suffix}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name = /^[a-z_]+$/i.test(name) ? name : `'${name}'`;
|
name = /^[a-z_]+$/i.test(name) ? name : `'${name}'`;
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ test("throw if prop uses an unknown suffix", async () => {
|
|||||||
|
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
await mount(Parent, fixture);
|
await mount(Parent, fixture);
|
||||||
}).rejects.toThrowError("Invalid prop suffix");
|
}).rejects.toThrowError("Invalid prop suffix: somesuffix");
|
||||||
});
|
});
|
||||||
|
|
||||||
test(".alike suffix in a simple case", async () => {
|
test(".alike suffix in a simple case", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user