-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bind the step function to the active domain (if present) #197
Conversation
@@ -121,8 +119,15 @@ | |||
} else { | |||
Promise.resolve(info.value).then(callNext, callThrow); | |||
} | |||
}; | |||
|
|||
if (process.domain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process
wont always be defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot about the browser environment; fixed
@@ -121,8 +119,15 @@ | |||
} else { | |||
Promise.resolve(info.value).then(callNext, callThrow); | |||
} | |||
}; | |||
|
|||
if (process && process.domain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still throw in browsers since process
wont be defined. You'll need to do typeof process !== "undefined"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not ensure that process is declared. It only ensures that process does not have a falsy value. It will still throw if it is not declared.typeof
is pretty much the only way to go here.
Not sure why our comments are marked as outdated. Either way, |
That makes sense. I should have known that. Fixed. |
Is there something else I need to do to get this merged? |
@benjamn ^ Not trying to be pushy but my team is stuck on this fork because our project uses domains and regenerator (through babel) and they'd like to get rid of the npm-shrinkwrap.json file. |
Bind the step function to the active domain (if present).
Published to NPM as v0.8.27: http://npmjs.org/package/regenerator |
@Andarist At the time this pull request was merged, there were still lots of Node projects that hadn't stopped using
It's probably safe to remove this now, if you want to submit a PR! |
wow, ive commented directly on the commit, had no idea my comment would land in the issue thread, nice! :) @benjamn thanks for the answer, I would love to send a PR, although I would include it as part of the #302 if you decide to give it a green light, if not - im gonna send a separate, small PR to remove those lines |
We're no longer using domains anymore, yeah. Don't have the time to send a PR but we won't notice it missing. |
This allows for libraries and applications 3 or 4 layers up to be able to use generators in a domain and have the domain context be persisted.
I've completed the CLA.