-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
π Search Terms
decorators addInitializer error
π Version & Regression Information
- This is the behavior in every version I tried since Stage 3 decorators where implemented
β― Playground Link
π» Code
let addInitializerFrom1: DecoratorContext["addInitializer"];
function dec1(_: any, ctx: DecoratorContext) {
addInitializerFrom1 = ctx.addInitializer;
}
function dec2(_: any, _2: any) {
addInitializerFrom1(() => {})
console.log("ADDED")
}
class A {
@dec2
@dec1
foo = 1;
}π Actual behavior
The addInitializerFrom1 call should throw
π Expected behavior
addInitializerFrom1 doesn't throw
Additional information about the issue
After that dec1 is called, decorationState.[[Finished]] for the decorationState relative to dec1 is set to false and thus calling addInitializer should throw.
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.