mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] app: support for arbitrary descriptors in env
Before this commit, when defining a getter in the env passed to the App, the value was read, losing the definition of the property. After this commit, declaring a getter in the env works as expected: the property stays a getter.
This commit is contained in:
committed by
Aaron Bohy
parent
3c12519277
commit
b66d5231d3
+2
-1
@@ -44,7 +44,8 @@ export class App<T extends typeof Component = any> extends TemplateSet {
|
||||
console.info(DEV_MSG);
|
||||
}
|
||||
if (config.env) {
|
||||
this.env = Object.freeze(Object.assign({}, config.env));
|
||||
const descrs = Object.getOwnPropertyDescriptors(config.env);
|
||||
this.env = Object.freeze(Object.defineProperties({}, descrs));
|
||||
}
|
||||
if (config.translateFn) {
|
||||
this.translateFn = config.translateFn;
|
||||
|
||||
Reference in New Issue
Block a user