-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
Evaluate some String and Array instance methods at compile time #505
Conversation
Is there a way to find out what |
Just run |
@boopathi I’m still getting the error after running It could be because I’m spreads ( |
Codecov Report
@@ Coverage Diff @@
## master #505 +/- ##
==========================================
+ Coverage 82.93% 83.42% +0.48%
==========================================
Files 41 42 +1
Lines 2743 2860 +117
Branches 958 1003 +45
==========================================
+ Hits 2275 2386 +111
- Misses 282 283 +1
- Partials 186 191 +5
Continue to review full report at Codecov.
|
Can you rebase with master ? I upgraded prettier today and fixed those things in master. |
@boopathi It looks like that didn’t fix the problem. |
We can get to the formatting issue later. I'll review the PR. |
const other = Symbol("other"); | ||
|
||
module.exports = ({ types: t }) => { | ||
const undef = t.identifier("undefined"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use void 0
instead of undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.unaryExpression(t.numericalLiteral(0))
@@ -0,0 +1,123 @@ | |||
const other = Symbol("other"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to a more descriptive one ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does fallback
sound better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boopathi Ping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure. What is this used for though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boopathi It is called when the mapping object doesn’t provide a handler for the specified key. For example, the Array
handler uses it to return the value at the specified index if the value can be coerced to an integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just bikeshedding, maybe - NO_HANDLER_FOUND
or FALLBACK_HANDLER
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boopathi Fixed. Sorry for the delay.
can you rebase with master and fix the CI errors ? |
Rebased and CI passing, @boopathi. |
Interesting why the smoke tests didn't kick in. |
@boopathi Do you want me to try and debug that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@j-f1 good to merge?
Sure! 👍 |
🎉 Thanks! |
Ref #501.