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

test: handles default export of anonymous class with correct name #4324 #4377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dnalborczyk
Copy link
Contributor

@dnalborczyk dnalborczyk commented Jan 31, 2022

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other -> test

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

[failing] test case for 4324

is test/function/samples/ the correct bucket?

@dnalborczyk dnalborczyk force-pushed the test/4324-anonymous-class-export branch from 9be2287 to bb142ba Compare January 31, 2022 00:55
@@ -0,0 +1,3 @@
import defaultClass from './foo.js';

assert.strictEqual('default', defaultClass.name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the name be undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that's essentially the bug. a default exported anonymous class has the name default. you can try it out in node.js or in a browser.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed you are right. Funny quirk.

Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test here is currently failing, are there plans to fix it?

@dnalborczyk
Copy link
Contributor Author

The test here is currently failing, are there plans to fix it?

yeah, the idea is that as soon as someone finds the time to fix the issue the test can be pulled in as well.

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

Successfully merging this pull request may close these issues.

None yet

3 participants