Skip to content
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

node.remove check entire stack #71

Open
hjdivad opened this issue Feb 15, 2017 · 3 comments
Open

node.remove check entire stack #71

hjdivad opened this issue Feb 15, 2017 · 3 comments

Comments

@hjdivad
Copy link
Collaborator

hjdivad commented Feb 15, 2017

we noted this when implementing it, but it has actually caused problems in ember-cli now

@runspired
Copy link
Collaborator

@hjdivad could you elaborate?

@stefanpenner
Copy link
Member

@runspired I believe the issue is, mid-built failures (or some async behavior) can legitimately cause orphaned nodes, that should still be removable?

@hjdivad
Copy link
Collaborator Author

hjdivad commented Feb 27, 2017

let p = heimdall.start('p');
let c = heimdall.start('c');

heimdall.stack === ['p', 'c']

// this will throw because `c` is the current node
c.remove()

// this will not throw, even though `p` is on the stack, it's not at the top of the stack
p.remove()

I think we didn't walk the stack out of some sense of the cost, but remove is a pretty rare operation and the overhead probably doesn't matter that much (especially in comparison to eg start)

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

No branches or pull requests

3 participants