mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix merge conflict
This commit is contained in:
@@ -121,31 +121,6 @@ class EnvironmentVariableAsync {
|
||||
*/
|
||||
Meteor.EnvironmentVariable = Meteor._isFibersEnabled ? EnvironmentVariableFibers : EnvironmentVariableAsync;
|
||||
|
||||
/**
|
||||
* @summary Set the environment variable to the given value while a function is run
|
||||
* @locus Anywhere
|
||||
* @method withValueAsync
|
||||
* @memberof Meteor.EnvironmentVariable
|
||||
* @param {Any} value Value the environment variable should be set to
|
||||
* @param {Function} func The function to run
|
||||
* @return {Any} Return value of function
|
||||
*/
|
||||
|
||||
EVp._set = function (context) {
|
||||
Meteor._nodeCodeMustBeInFiber();
|
||||
Fiber.current._meteor_dynamics[this.slot] = context;
|
||||
};
|
||||
|
||||
EVp._setNewContextAndGetCurrent = function (value) {
|
||||
Meteor._nodeCodeMustBeInFiber();
|
||||
if (!Fiber.current._meteor_dynamics) {
|
||||
Fiber.current._meteor_dynamics = [];
|
||||
}
|
||||
const saved = Fiber.current._meteor_dynamics[this.slot];
|
||||
this._set(value);
|
||||
return saved;
|
||||
};
|
||||
|
||||
// Meteor application code is always supposed to be run inside a
|
||||
// fiber. bindEnvironment ensures that the function it wraps is run from
|
||||
// inside a fiber and ensures it sees the values of Meteor environment
|
||||
|
||||
Reference in New Issue
Block a user