Evaluate simple expressions that resolve to a constant value
See original GitHub issuecss={{ fontSize: 2 + 2 }}
.cc {
font-size: 4; // reduced to 4
}
handle:
- multiplication
- addition
- subtraction
- division
on:
- strings
- numbers
- identifiers that resolve to a constant string or number
Use babel path method path.evaluate
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Compile-time constants, constant expressions, and constexpr
A constant expression is an expression that can be evaluated by the compiler at compile-time. To be a constant expression, all the values...
Read more >"function call must have a constant value in a ... - Stack Overflow
I'm using Visual Studio 2015, FYI. Error messages: Error C2131 expression did not evaluate to a constant Basic Server c:\<snip> 28 Error C2131 ......
Read more >Program to evaluate simple expressions - GeeksforGeeks
utility function to find value of and operand. int value( char c) { return (c - '0' ); }. // This function evaluates...
Read more >6. Expressions
can be completely resolved at parse time (i.e., constant expressions), and those that can only be resolved at run time. (i.e., variable expressions)....
Read more >What are Compile-time Constants in Java? - Baeldung
The Java compiler is able to pre-calculate certain values for us at compile time. This allows us to use some variables with expressions...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

yeah - finding the bindings works out of the box. we just need some extra code to do the module traversal stuff - i reckon when we start doing the actual work we can refactor this first.
yups, instead of storing declarations, lets find the bindings. Atleast that binding will be limited to a particular scope right.
Doing like this:
might end up with same
declarationName. Not sure, but there can be a possibility.Instead, lets traverse upwards and find the binding. Worst case will be that we have to traverse module boundaries, but thats the worst case right. We can work on a fallback if possible in case we are not able to traverse module boundaries. Nice work btw ❤️