mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-05 15:17:32 +08:00
WIP
This commit is contained in:
@@ -146,9 +146,9 @@ export default class IEntity {
|
||||
* @this {T}
|
||||
* @returns {T}
|
||||
*/
|
||||
static asUniqueClass() {
|
||||
static asUniqueClass(alwaysCreate = false) {
|
||||
let result = this
|
||||
if (this.name.length) {
|
||||
if (this.name.length || alwaysCreate) {
|
||||
// @ts-expect-error
|
||||
result = (() => class extends this { })() // Comes from a lambda otherwise the class will have name "result"
|
||||
result.grammar = result.createGrammar() // Reassign grammar to capture the correct this from subclass
|
||||
|
||||
Reference in New Issue
Block a user