| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This will consume iterator entirely and make it useless
Sorry, something went wrong.
There was a problem hiding this comment.
For Maps and Sets?
Sorry, something went wrong.
There was a problem hiding this comment.
If you print an iterator, python just prints the type of iterator. May be we should do the same. Otherwise we'll exhaust the iterator as vkurchatkin pointed out.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah yea, I see what you mean.
Sorry, something went wrong.
There was a problem hiding this comment.
So I guess that means that we will have to use Debug.MakeMirror and fetch the values?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes.
Sorry, something went wrong.
There was a problem hiding this comment.
Style nit. Or operator should be in the previous line.
Sorry, something went wrong.
There was a problem hiding this comment.
@thefourtheye Do we have an eslint rule for that, btw?
Sorry, something went wrong.
There was a problem hiding this comment.
make lint passes with both. Be happy to change if that is the preferred way though
Sorry, something went wrong.
There was a problem hiding this comment.
Doesn't it fit on one line? It works out to exactly 80 characters, doesn't it?
Sorry, something went wrong.
|
Updated to use Debug.MakeMirror. It also takes advantage of using IteratorMirror.preview which does not change the backing iterator state. |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you rebase and use ensureDebugIsInitialized() here?
Sorry, something went wrong.
|
Updated to utilize v8::Value::IsMapIterator and v8::Value::IsSetIterator |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you name this binding? That's more in line with other source files.
Sorry, something went wrong.
|
Mostly LGTM. I think the constructor.name === 'Array' check should come with regression tests of its own. |
Sorry, something went wrong.
|
Alright, broke out the constructor.name === 'Array' check into it's own commit with a test. Is that single test sufficient or should I add more? Honestly, the only other way I've been able to reproduce it is from the map/set iterators |
Sorry, something went wrong.
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
In the event an Array is created in a Debug context, the constructor will be Array, but !== Array. This adds a check constructor.name === 'Array' to handle edge cases like that. PR-URL: nodejs#3119 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Previously, a MapIterator or SetIterator would not be inspected properly. This change makes it possible to inspect them by creating a Debug Mirror and previewing the iterators to not consume the actual iterator that we are trying to inspect. This change also adds a node_util binding that uses v8's Value::IsSetIterator and Value::IsMapIterator to verify that the values passed in are actual iterators. Fixes: nodejs#3107 PR-URL: nodejs#3119 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sorry, something went wrong.
In the event an Array is created in a Debug context, the constructor will be Array, but !== Array. This adds a check constructor.name === 'Array' to handle edge cases like that. PR-URL: #3119 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Previously, a MapIterator or SetIterator would not be inspected properly. This change makes it possible to inspect them by creating a Debug Mirror and previewing the iterators to not consume the actual iterator that we are trying to inspect. This change also adds a node_util binding that uses v8's Value::IsSetIterator and Value::IsMapIterator to verify that the values passed in are actual iterators. Fixes: #3107 PR-URL: #3119 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
| Back | FazBrowse Home | New Git URL |
Currently, inspecting new Map().keys() or other iterators will return an empty object.
I am opening more for discussion of how we want (if at all) to address not being able to inspect map and set iterators. I first had first attempting using Debug.MakeMirror but the performance of doing it this way was about 10x better.
Related: #3107