addInitializer
incorrectly throws if decorator throws
#9078
Labels
Milestone
addInitializer
incorrectly throws if decorator throws
#9078
Describe the bug
Calling
addInitializer
from a class decorator context throws if the decorator threw. As per spec this should not happen. Babel behaves correctly: https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=DYUwLgBAhgJjCSA7AlmZVjIF4gE4G4AoAMwFdEBjNAe0QhhAoAoB9AGgioA8BKCAbwhgAFrmoB3AdDhJU6TDlwQAvhAC8nMF3wrCYXAE8pFYFADOZiAEEpAAQYUIAWyZ9-qj5yhgKwgcsJCWAQUNAxsPCZXdQA-fx4iINBcMCYAIgAHczMQGDSeQiA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.24.7&externalPlugins=&assumptions=%7B%7DInput code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.6.1&code=H4sIAAAAAAAAA1WMSwrEMAxD9z6FlinMDUKHdtlTlOBkaCBNIHGZT8ndx10WLSyhZ6UgcN4vOUp0Kf5CtfQ6MkssGT6wWR9g%2BQw4IVstb713HB3jRVh0kvrVnpNrDbO6SQewG33uuMROeNNAdN8wioxPLQZLfxsNdaCRAAAA&config=H4sIAAAAAAAAA3VQuwrDMAzc8xVBcwohhQ6du3btbhwluPiF5EBDyL%2FXzjuULkbSWXenG7I8hzdLuOdDLGPjBTHS1scJ9zaIT5xA6D2yJOUDFCsaOEGN0IzbrEbpSARHHKFAHU7AOOMQBLUYEh9yVVbVwgXaOcYzFxhlVdMf3UhnPCHzj6gRttXb%2FlmRhOXGkTkSaWyF7B%2Br1f9HvJBYOZsMJ7uX8go7%2B%2FSAcXU3aS8hpqDmA2%2Bwf1pv2XRA8XPdTDEVGeDHIymDMXI98WVjNn4BiKKsl6YBAAA%3D
SWC Info output
No response
Expected behavior
addInitializer
does not throw.Actual behavior
addInitializer
throws.Version
1.6.1
Additional context
This throws because SWC sets
decorationState.[[Finished]]
totrue
even if the decorator threw. This should not be the case - it should stayfalse
.The text was updated successfully, but these errors were encountered: