mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
- use Meteor._debug instead of console.warn
- add comments to not change the behavior of withValues() (client)
This commit is contained in:
@@ -614,7 +614,7 @@ export class Connection {
|
||||
stubOptions.stubReturnValue = DDP._CurrentMethodInvocation
|
||||
.withValue(invocation, stubInvocation);
|
||||
if (Meteor._isPromise(stubOptions.stubReturnValue)) {
|
||||
console.warn(
|
||||
Meteor._debug(
|
||||
`Method ${name}: Calling a method that has an async method stub with call/apply can lead to unexpected behaviors. Use callAsync/applyAsync instead.`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ EVp.getOrNullIfOutsideFiber = function () {
|
||||
* @returns {any} The return value of the function
|
||||
*/
|
||||
EVp.withValue = function (value, func) {
|
||||
// WARNING: Do not change the behavior of this function.
|
||||
// If you compare this function to it's version in the server-side, you'll see that there we handle async results.
|
||||
// In the client we don't need to do this. If we try to, it can lead to problems like this:
|
||||
// https://github.com/meteor/meteor/pull/13198#issuecomment-2181254734/.
|
||||
var saved = currentValues[this.slot];
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user