Open EduFrazao opened 5 months ago
I tested in the current 1.7.15 snapshot, indeed:
var x = undefined;
if(x) print(x) //yields nothing
if(!x) print(x) //prints "undefined"
I also checked Boolean(undefined)
. This evaluates to false as it should, so maybe there's something wrong with the if logic.
For the second issue, mine printed undefined
so this was probably fixed.
I'll add these as test cases when I familiarize myself more with the repo.
I tested in the current 1.7.15 snapshot, indeed:
var x = undefined; if(x) print(x) //yields nothing if(!x) print(x) //prints "undefined"
I also checked
Boolean(undefined)
. This evaluates to false as it should, so maybe there's something wrong with the if logic. For the second issue, mine printedundefined
so this was probably fixed.I'll add these as test cases when I familiarize myself more with the repo.
Hi. Thanks for testing. Did you test the output of "typeof x" after set it as undefined?
@EduFrazao Rhino 1.7.15 had been released.
Could you validate if the issue you had in 1.7.14 is still present our not?
If this issue is still present in 1.7.15, it would be great if you could try it before and after the merging of https://github.com/mozilla/rhino/pull/979, which is a merged PR that made changes in the area of undefined handling
@gbrail any chance this regression might be due to the changes you made in #979?
@gbrail quick ping in case this fell off the bottom of the list 🙂
I tried this on the master branch and I didn't see the original behavior described, so I'd want to understand what exactly the original poster did to get this result.
On Wed, Aug 21, 2024 at 9:48 AM Paul Bakker @.***> wrote:
@gbrail https://github.com/gbrail quick ping in case this fell off the bottom of the list 🙂
— Reply to this email directly, view it on GitHub https://github.com/mozilla/rhino/issues/1458#issuecomment-2302538132, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7I226Q6OJIPQRMCYPCZDZSTAEJAVCNFSM6AAAAABFCEVCUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBSGUZTQMJTGI . You are receiving this because you were mentioned.Message ID: @.***>
My bad, I misread the second comment in that I thought it confirmed the bug, but it did the opposite
@EduFrazao please provide more details on how to reproduce or at least how you interact with Rhino/execute your JS code, because we cannot reproduce the behaviour your reporting, neither in master not with the 1.7.14 release
Without a way to reproduce the issue, there's not much we can do with this case
Hi. Undefined or not initialized variables presents a strange behavior in version 1.7.14
Like this code:
Not initialized variables also reports its types as strings
This codes prints: "string"
Is this somehow expected?
Edit note: With 1.7.13 works fine.