editor: fix regression in code editor making global variables unrecognized

This commit is contained in:
jean-emmanuel 2025-12-23 16:41:56 +01:00
parent 5785a5e026
commit 9abfb85739

View file

@ -207,9 +207,7 @@ class CodeEditor {
if (this.language === 'javascript') {
let globals = {}
for (var k in scriptGlobals) {
globals[k] = true
}
if (this.name === 'onKeyboard') {
globals = {type: true, key: true, code: true, ctrl: true, shift: true, alt: true, meta: true}
} else if (this.name === 'onCreate') {
@ -226,6 +224,9 @@ class CodeEditor {
globals = {value: true, height: true, width: true, cssVars: true}
}
for (var k in scriptGlobals) {
globals[k] = true
}
globals.locals = true
globals.console = true