From 156e659188164889e8d92ec0edb3577bb4edcff9 Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Wed, 10 Apr 2024 14:36:13 +0100 Subject: [PATCH] ESM attributes rename (#6229) * refactoring attributesDefinition to attributes * ensure proper assignment --- src/framework/handlers/script.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/framework/handlers/script.js b/src/framework/handlers/script.js index 7639719170d..eb59fdcf3fb 100644 --- a/src/framework/handlers/script.js +++ b/src/framework/handlers/script.js @@ -6,6 +6,7 @@ import { registerScript } from '../script/script.js'; import { ResourceLoader } from './loader.js'; import { ResourceHandler } from './handler.js'; +import { ScriptAttributes } from '../script/script-attributes.js'; /** * Resource handler for loading JavaScript files dynamically. Two types of JavaScript files can be @@ -154,13 +155,13 @@ class ScriptHandler extends ResourceHandler { const extendsScriptType = scriptClass.prototype instanceof ScriptType; if (extendsScriptType) { - - if (script.attributesDefinition) { - for (const key in script.attributesDefinition) { - scriptClass.attributes.add(key, script.attributesDefinition[key]); + if (scriptClass.attributes) { + const attributes = new ScriptAttributes(scriptClass); + for (const key in script.attributes) { + attributes.add(key, scriptClass.attributes[key]); } + scriptClass.attributes = attributes; } - registerScript(scriptClass, scriptClass.name.toLowerCase()); } }