Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests failing since @babel/plugin-transform-classes 7.16.5 #60

Open
AprilArcus opened this issue Dec 7, 2022 · 0 comments
Open

Comments

@AprilArcus
Copy link

AprilArcus commented Dec 7, 2022

Since@babel/plugin-transform-classes 7.16.5, seven unit tests are failing:

not ok 467 ES5: simple class
not ok 481 ES5: annotated class
not ok 482 ES5 explicitOnly: annotated class
not ok 489 ES5: annotated constructor
not ok 490 ES5 explicitOnly: annotated constructor
not ok 493 ES5: constructor with prologue directive
not ok 494 ES5 explicitOnly: constructor with prologue directive

I bisected the issue to this line diff in commit babel/babel@acda160 in the PR babel/babel#12115

It looks like in ES5 mode, @babel/plugin-transform-classes transforms class declarations to function expressions (which are still recognized by babel-plugin-angularjs-annotate as annotation candidates), but following 7.16.5, these expressions are now wrapped in the _createClass() helper, which babel-plugin-angularjs-annotate does not recognize as eligible for annotation.

This issue would have been caught by the test suite with earlier versions of @babel/plugin-transform-classes if additional methods besides the constructor had been present in the test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant