[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:
Romain Derie
2025-01-02 15:24:32 +01:00
committed by Sam Degueldre
parent 17f4823b13
commit 9b656fd9e4
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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}'`;
+1 -1
View File
@@ -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 () => {