Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

ES2015 iterator object of the generator has undefined value in watch #41

Closed
life777 opened this issue Jan 25, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@life777
Copy link

life777 commented Jan 25, 2016

Code looks ike this:

function* getFiles() {
    let urls = [].slice.call(arguments);

    let results = yield urls.map(function(url){
        return new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve("new value");
            }, 1000);
        });
    });
    results.forEach((val) => { console.log(val) });
}

let iterator = getFiles("file1", "file2", "file3");
//iterator is undefined
Promise.all(iterator.next().value).then(function(results){
    iterator.next(results);
});

If I set debugger after I created an generator's iterator and place this variable into watch section (or just hover it with mouse pointer) I'll see that variable "iterator" has "undefined" value.

@weinand weinand added the bug label Feb 8, 2016
@weinand weinand self-assigned this Feb 8, 2016
@weinand weinand added this to the backlog milestone Feb 8, 2016
@weinand
Copy link
Contributor

weinand commented Feb 8, 2016

@life777 this is a limitation of the the node debugger protocol. Node-inspector shows the same result, right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants