-
Notifications
You must be signed in to change notification settings - Fork 893
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
Sleepy __len__. #619
Sleepy __len__. #619
Conversation
a) Not necessarily ridiculous; I think have code that looks very much like this and given that your test fails, I'm somewhat surprised it works! b) I'm not sure this fix is quite safe. The whole point of the little hack here is that the skuplt-named functions ( Therefore, I suspect that the bug you're encountering is actually that |
On line 55 of type.js "__len__": ["sq$length", 0] which causes this check to fail and go to the if (canSuspendIdx) { But when I change this to |
Excellent. So that code was, in fact, entirely broken, and somehow my testing failed to capture it. Go me. Where is the |
So it expects to get the |
I think the check just needs to be changed to:
@meredydd, I think that's what you were trying to check for, but you passed an index of 0 (legitimately), which evaluates to false. I didn't test this or anything, but looking at the code, I think this is at least what you meant. |
I also think you need:
As this is what gets called from |
@albertjan, unfortunately, I don't think you can do this. I'm sure there are places that call |
3rd times a charm, the suspendIdx should not have been 0 because |
LGTM |
@skulpt/committers merge at will 😄. |
I know it's absolutely ridiculous, but you brought it up @meredydd.
This didn't work:
This PR fixes that 😄 Although I don't know if this is correct.