[IMP] compiler: generate templates in strict mode

Before this commit, generated template functions were not using strict
mode. This may be a bad idea, since strict mode could be more performant
in some cases.
This commit is contained in:
Géry Debongnie
2022-06-24 15:50:43 +02:00
parent 7f580a4e1d
commit 2068196377
47 changed files with 1367 additions and 1 deletions
@@ -3,6 +3,7 @@
exports[`loading templates addTemplates does not modify its xml document in place 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -17,6 +18,7 @@ exports[`loading templates addTemplates does not modify its xml document in plac
exports[`loading templates can initialize qweb with a string 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>jupiler</div>\`);
@@ -30,6 +32,7 @@ exports[`loading templates can initialize qweb with a string 1`] = `
exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>jupiler</div>\`);
@@ -43,6 +46,7 @@ exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
exports[`loading templates can load a few templates from a xml string 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`items\`);
@@ -58,6 +62,7 @@ exports[`loading templates can load a few templates from a xml string 1`] = `
exports[`loading templates can load a few templates from a xml string 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<li>ok</li>\`);
@@ -74,6 +79,7 @@ exports[`loading templates can load a few templates from a xml string 2`] = `
exports[`loading templates can load a few templates from an XMLDocument 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`items\`);
@@ -89,6 +95,7 @@ exports[`loading templates can load a few templates from an XMLDocument 1`] = `
exports[`loading templates can load a few templates from an XMLDocument 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<li>ok</li>\`);