Skip to content

Commit

Permalink
Update transform_file.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaMan123 committed Jun 11, 2022
1 parent 5a4fc01 commit ec4b362
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/transform_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ function transformFile(raw, { namespace, name } = {}) {
raw = raw.slice(0, result.index) + raw.slice(found.end+1);
}
raw = `//@ts-nocheck\n${raw}`;
//raw = `${raw}\n/** @todo TODO_JS_MIGRATION remove next line after refactoring build */\n${namespace} = ${name};\n`;
return raw;
}

Expand Down Expand Up @@ -242,7 +241,7 @@ function transformClass(type, raw, className) {
} while (transformed !== rawClass);
rawClass = removeCommas(rawClass);
const classDirective = type === 'mixin' ?
generateMixin(rawClass, className.indexOf(name)===-1?`${_.upperFirst(name)}${className}`:className || name, namespace) :
generateMixin(rawClass, `${_.upperFirst(name)}${className.replace(new RegExp(name, 'i'), '')}` || name, namespace) :
generateClass(rawClass, className || name, superClass);
raw = `${raw.slice(0, match.index)}${classDirective}${raw.slice(end + 1).replace(/\s*\)\s*;?/, '')}`;
if (type === 'mixin') {
Expand All @@ -253,6 +252,9 @@ function transformClass(type, raw, className) {

}
}
if (type === 'class') {
raw = `${raw}\n/** @todo TODO_JS_MIGRATION remove next line after refactoring build */\n${namespace} = ${name};\n`;
}
raw = transformFile(raw, { namespace, name });
return { name, raw, staticCandidantes, requiresSuperClassResolution, superClasses };
}
Expand Down

0 comments on commit ec4b362

Please sign in to comment.