Skip to content

Commit

Permalink
ESM attributes rename (#6229)
Browse files Browse the repository at this point in the history
* refactoring attributesDefinition to attributes

* ensure proper assignment
  • Loading branch information
marklundin authored Apr 10, 2024
1 parent 1773f23 commit 156e659
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/framework/handlers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
}
}
Expand Down

0 comments on commit 156e659

Please sign in to comment.