mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] playground: add missing ;
Because of that missing ";", the playground application tried to inject this: window.TEMPLATES = `...` instead of this: window.TEMPLATES = `...`; So, when the following line started with a (, then the javascript code was interpreted as a function call. And it could happen, because some people like to use the IIFE syntax to have some contained code.
This commit is contained in:
@@ -90,7 +90,7 @@ function makeCodeIframe(js, css, xml, errorHandler) {
|
|||||||
owlScript.addEventListener("load", () => {
|
owlScript.addEventListener("load", () => {
|
||||||
const script = doc.createElement("script");
|
const script = doc.createElement("script");
|
||||||
script.type = "text/javascript";
|
script.type = "text/javascript";
|
||||||
const content = `owl.__info__.mode = 'dev';\nwindow.TEMPLATES = \`${sanitizedXML}\`\n${js}`;
|
const content = `owl.__info__.mode = 'dev';\nwindow.TEMPLATES = \`${sanitizedXML}\`;\n${js}`;
|
||||||
script.innerHTML = content;
|
script.innerHTML = content;
|
||||||
iframe.contentWindow.addEventListener("error", errorHandler);
|
iframe.contentWindow.addEventListener("error", errorHandler);
|
||||||
iframe.contentWindow.addEventListener("unhandledrejection", errorHandler);
|
iframe.contentWindow.addEventListener("unhandledrejection", errorHandler);
|
||||||
|
|||||||
Reference in New Issue
Block a user