Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Class Variable Support#209

Unanswered
esb asked this question inQ&A
Apr 24, 2024· 2 comments
Discussion options

From my understanding,@@ class variables are a little bit restricted.

I'm not interested in private variables, so I useunderscored_private: true with ES2022.

If I define@@variable = nil inMyClass, I getMyClass._variable = null

It would be nice to havethis.constructor._variable generated instead, but I guess that's not important.

The real problem for me is that I'm interfacing with base and sub-classes that are native JS and they use specific static variable names that I can't control. For example, in this instance, the static variable would be defined asstatic variable = null, so I've got an obvious mismatch as ruby2js will generate the name with a_ prefix.

Is there anyway that this could be configured?

You must be logged in to vote

Replies: 2 comments

Comment options

@esb Yeah I like that idea, started noodling around with an update. What's a good config option I wonder?public_class_variables?

You must be logged in to vote
0 replies
Comment options

Would it be useful to allow the prefix to be defined? The default would be "_", but it could be set to "" or false to disable the prefix entirely.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@esb@jaredcwhite

[8]ページ先頭

©2009-2025 Movatter.jp