Skip to content

Commit

Permalink
fix(helpers): field decorators also have addInitializer now
Browse files Browse the repository at this point in the history
  • Loading branch information
phiresky committed Feb 7, 2024
1 parent e40a08a commit 0b2a030
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/helpers/esm/_apply_decs_2203_r.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ export function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentCla

var decoratorFinishedRef = { v: false };

if (kind !== 0 /* FIELD */) {
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
}
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);

var get, set;
if (kind === 0 /* FIELD */) {
Expand Down Expand Up @@ -306,17 +304,13 @@ export function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentCla
base = Class;
kind = kind - 5 /* STATIC */;
// initialize staticInitializers when we see a non-field static member
if (kind !== 0 /* FIELD */) {
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
}
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
} else {
base = Class.prototype;
// initialize protoInitializers when we see a non-field member
if (kind !== 0 /* FIELD */) {
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}

if (kind !== 0 /* FIELD */ && !isPrivate) {
Expand Down

0 comments on commit 0b2a030

Please sign in to comment.