Skip to content

Commit

Permalink
explicit bitwise operators for initializer flags
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed May 15, 2024
1 parent ba548df commit 90acd14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/js_parser/js_parser_lower_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ func (ctx *lowerClassContext) insertInitializersIntoConstructor(p *parser, class
if ctx.decoratorCallInstanceMethodExtraInitializers {
decoratorInstanceMethodExtraInitializers = p.callRuntime(ctx.classLoc, "__runInitializers", []js_ast.Expr{
{Loc: ctx.classLoc, Data: &js_ast.EIdentifier{Ref: ctx.decoratorContextRef}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: 5}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: (2 << 1) | 1}},
{Loc: ctx.classLoc, Data: js_ast.EThisShared},
})
p.recordUsage(ctx.decoratorContextRef)
Expand Down Expand Up @@ -2183,7 +2183,7 @@ func (ctx *lowerClassContext) finishAndGenerateCode(p *parser, result visitClass
if ctx.decoratorCallStaticMethodExtraInitializers {
suffixExprs = append(suffixExprs, p.callRuntime(ctx.classLoc, "__runInitializers", []js_ast.Expr{
{Loc: ctx.classLoc, Data: &js_ast.EIdentifier{Ref: ctx.decoratorContextRef}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: 3}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: (1 << 1) | 1}},
ctx.nameFunc(),
}))
p.recordUsage(ctx.decoratorContextRef)
Expand All @@ -2201,7 +2201,7 @@ func (ctx *lowerClassContext) finishAndGenerateCode(p *parser, result visitClass
if decorateClassExpr.Data != nil {
suffixExprs = append(suffixExprs, p.callRuntime(ctx.classLoc, "__runInitializers", []js_ast.Expr{
{Loc: ctx.classLoc, Data: &js_ast.EIdentifier{Ref: ctx.decoratorContextRef}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: 1}},
{Loc: ctx.classLoc, Data: &js_ast.ENumber{Value: (0 << 1) | 1}},
ctx.nameFunc(),
}))
p.recordUsage(ctx.decoratorContextRef)
Expand Down

0 comments on commit 90acd14

Please sign in to comment.