diff --git a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.xml b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.xml index 067ff71aec1..b17c6c9e5c2 100644 --- a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.xml +++ b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.xml @@ -3,7 +3,7 @@
- +
diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js index c32ded87262..a8a5bdfa50c 100644 --- a/addons/web/static/lib/owl/owl.js +++ b/addons/web/static/lib/owl/owl.js @@ -1759,7 +1759,7 @@ * @returns the raw type of the object */ function rawType(obj) { - return objectToString.call(obj).slice(8, -1); + return objectToString.call(toRaw(obj)).slice(8, -1); } /** * Checks whether a given value can be made into a reactive object. @@ -2309,7 +2309,8 @@ } } this.component = new C(props, env, this); - this.renderFn = app.getTemplate(C.template).bind(this.component, this.component, this); + const ctx = Object.assign(Object.create(this.component), { this: this.component }); + this.renderFn = app.getTemplate(C.template).bind(this.component, ctx, this); this.component.setup(); currentNode = null; } @@ -2500,6 +2501,7 @@ } _patch() { let hasChildren = false; + // eslint-disable-next-line @typescript-eslint/no-unused-vars for (let _k in this.children) { hasChildren = true; break; @@ -2894,8 +2896,8 @@ } return slotBDom || text(""); } - function capture(ctx, component) { - const result = ObjectCreate(component); + function capture(ctx) { + const result = ObjectCreate(ctx); for (let k in ctx) { result[k] = ctx[k]; } @@ -2950,7 +2952,7 @@ class LazyValue { constructor(fn, ctx, component, node, key) { this.fn = fn; - this.ctx = capture(ctx, component); + this.ctx = capture(ctx); this.component = component; this.node = node; this.key = key; @@ -3110,7 +3112,7 @@ if (line[columnIndex]) { msg += `\nThe error might be located at xml line ${lineNumber} column ${columnIndex}\n` + - `${line}\n${"-".repeat(columnIndex - 1)}^`; + `${line}\n${"-".repeat(columnIndex - 1)}^`; } } } @@ -3232,7 +3234,7 @@ //------------------------------------------------------------------------------ // Misc types, constants and helpers //------------------------------------------------------------------------------ - const RESERVED_WORDS = "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,eval,void,Math,RegExp,Array,Object,Date".split(","); + const RESERVED_WORDS = "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date".split(","); const WORD_REPLACEMENT = Object.assign(Object.create(null), { and: "&&", or: "||", @@ -3710,7 +3712,7 @@ for (let block of this.blocks) { if (block.dom) { let xmlString = block.asXmlString(); - xmlString = xmlString.replace(/`/g, "\\`"); + xmlString = xmlString.replace(/\\/g, "\\\\").replace(/`/g, "\\`"); if (block.dynamicTagName) { xmlString = xmlString.replace(/^<\w+/, `<\${tag || '${block.dom.nodeName}'}`); xmlString = xmlString.replace(/\w+>$/, `\${tag || '${block.dom.nodeName}'}>`); @@ -3817,16 +3819,16 @@ const mapping = new Map(); return tokens .map((tok) => { - if (tok.varName && !tok.isLocal) { - if (!mapping.has(tok.varName)) { - const varId = generateId("v"); - mapping.set(tok.varName, varId); - this.define(varId, tok.value); - } - tok.value = mapping.get(tok.varName); + if (tok.varName && !tok.isLocal) { + if (!mapping.has(tok.varName)) { + const varId = generateId("v"); + mapping.set(tok.varName, varId); + this.define(varId, tok.value); } - return tok.value; - }) + tok.value = mapping.get(tok.varName); + } + return tok.value; + }) .join(""); } /** @@ -3927,11 +3929,11 @@ .split(".") .slice(1) .map((m) => { - if (!MODS.has(m)) { - throw new OwlError(`Unknown event modifier: '${m}'`); - } - return `"${m}"`; - }); + if (!MODS.has(m)) { + throw new OwlError(`Unknown event modifier: '${m}'`); + } + return `"${m}"`; + }); let modifiersCode = ""; if (modifiers.length) { modifiersCode = `${modifiers.join(",")}, `; @@ -4508,7 +4510,7 @@ if (this.target.loopLevel || !this.hasSafeContext) { ctxStr = generateId("ctx"); this.helpers.add("capture"); - this.define(ctxStr, `capture(ctx, this)`); + this.define(ctxStr, `capture(ctx)`); } let slotStr = []; for (let slotName in ast.slots) { @@ -4667,7 +4669,7 @@ if (this.target.loopLevel || !this.hasSafeContext) { ctxStr = generateId("ctx"); this.helpers.add("capture"); - this.define(ctxStr, `capture(ctx, this)`); + this.define(ctxStr, `capture(ctx)`); } let id = generateId("comp"); this.staticDefs.push({ @@ -5412,7 +5414,7 @@ if (line[columnIndex]) { msg += `\nThe error might be located at xml line ${lineNumber} column ${columnIndex}\n` + - `${line}\n${"-".repeat(columnIndex - 1)}^`; + `${line}\n${"-".repeat(columnIndex - 1)}^`; } } } @@ -5856,9 +5858,9 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration Object.defineProperty(exports, '__esModule', { value: true }); - __info__.version = '2.0.2'; - __info__.date = '2022-11-29T14:11:21.188Z'; - __info__.hash = 'ef8baa2'; + __info__.version = '2.0.3'; + __info__.date = '2023-01-12T15:32:52.837Z'; + __info__.hash = '316eb06'; __info__.url = 'https://github.com/odoo/owl';