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

CoffeeScript incompatibility with predefined values #944

Open
bbrk24 opened this issue Feb 6, 2024 · 2 comments
Open

CoffeeScript incompatibility with predefined values #944

bbrk24 opened this issue Feb 6, 2024 · 2 comments
Labels
bug Something isn't working coffeescript CoffeeScript compatibility related

Comments

@bbrk24
Copy link
Contributor

bbrk24 commented Feb 6, 2024

'civet coffeeCompat'

class Foo
  [Symbol.toStringTag]: 'Foo'

console.log Foo::[Symbol.toStringTag]

This prints 'Foo' in CoffeeScript and undefined in Civet.

@STRd6 STRd6 added bug Something isn't working coffeescript CoffeeScript compatibility related labels Feb 6, 2024
@edemaine
Copy link
Collaborator

edemaine commented Feb 6, 2024

One could argue that this is a bug in CoffeeScript. See jashkenas/coffeescript#4552 (especially toward the end).

That said, it currently is how CoffeeScript works, so it probably make sense to have a compatibility flag that triggers CoffeeScript's IIFE behavior, and perhaps the same coffeeClasses flag makes sense. Related to #457.

@STRd6
Copy link
Contributor

STRd6 commented Feb 15, 2024

As a workaround you can do this:

'civet coffeeCompat'

class Foo
  get [Symbol.toStringTag]() 'Foo'

console.log Foo::[Symbol.toStringTag]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working coffeescript CoffeeScript compatibility related
Projects
None yet
Development

No branches or pull requests

3 participants