You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How do you intend to use the Symbol itself? You can't really import things from the very code you're analyzing and expect object equalities there. It's the same logic as not being able to get AST of a function and then just .call it or something.
How do you intend to use the Symbol itself? You can't really import things from the very code you're analyzing and expect object equalities there. It's the same logic as not being able to get AST of a function and then just .call it or something.
Hey! Thanks for your answer.
Since Symbols are valid property keys, I thought it would be possible to get a property by a symbol.
So, I assume the only way to get it, is how I did it (i.e check if the name starts with __@HEADERS).
They are valid keys in the code, but that doesn't mean you can use the symbol from the runtime of your code and expect it to work when inspecting that code's AST using a library like this. Functions can also be called, and yet having an AST of a function doesn't mean you can call it.
Is your feature request related to a problem? Please describe.
Hi.
I have a symbol called
HEADERS
, defined as follows:I'm using this symbol to augment the type of a method:
Now, when I read the AST of this method, I have access to the ObjectType, which is
I want to get the [HEADERS] property using my symbol
But that's not possible, cuz the
getProperty
method accepts only a string as parameter or a function. For the latter, I did this and it worked... but I wonder if it's possible to use only the symbol.
Describe the solution you'd like
The
getProperty
method should accept a symbol as parameter.Describe alternatives you've considered
Is it possible to achieve this, please?
The text was updated successfully, but these errors were encountered: