Return callback to produce a usable value, or continue execution
519564
function nextup(inst, orig, argv, event, cb) {
    return function nextupCallback(err, data) {
        if (err) return cb(err, null);
        if (_isQuoted(data)) return cb(null, _unquote(data));
        if (_isValue(data)) return cb(null, _entityToValue(data, inst.library));
        // Remove any nulls or undefineds from the list
        var compact = _compactList(data);
        // Allow the programmer to opt out for _minor_ perf gains
        if (inst.options.doIrreducibleListCheck) {
            // If no change, we'll keep looping forever, so just return
            if (IsEqual(orig, compact)) {
                Console.printWarning(inst, 'Detected irreducible list; exiting...');
                return cb(null, compact);
            }
        }
        return exec(inst, compact, argv, event, cb);
    };
}
328018
def _run_callback(self, callback):
        
        try:
            ret = callback()
            if ret is not None:
                from . import gen
                # Functions that return Futures typically swallow all
                # exceptions and store them in the Future.  If a Future
                # makes it out to the IOLoop, ensure its exception (if any)
                # gets logged too.
                try:
                    ret = gen.convert_yielded(ret)
                except gen.BadYieldError:
                    # It's not unusual for add_callback to be used with
                    # methods returning a non-None and non-yieldable
                    # result, which should just be ignored.
                    pass
                else:
                    self.add_future(ret, self._discard_future_result)
        except Exception:
            self.handle_callback_exception(callback)
311402
def on_self
      scope  = current_scope
      method = scope.lookup(scope.method_call_type, 'self')

      push_value(method.return_value)
    end
967363
def callback(params, returns, &block)
      Win32::API::Callback.new(params, returns, &block)
    end
1008525
function (callback) {
            return when(this, function (value) {
                return callback(value, true);
            }, function (reason) {
                return callback(reason, false);
            });
        }
732045
def make_result(self, key, value):
        
        v = OperationResult()
        v.key = key
        return v
589266
def execute_callback(self, *args, **kwargs):
        
        response = self._sijax.execute_callback(*args, **kwargs)
        return _make_response(response)
724060
def return_action(self, text, loc, ret):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("RETURN:",ret)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        if not self.symtab.same_types(self.shared.function_index, ret.exp[0]):
            raise SemanticException("Incompatible type in return")
        #set register for function's return value to expression value
        reg = self.codegen.take_function_register()
        self.codegen.move(ret.exp[0], reg)
        #after return statement, register for function's return value is available again
        self.codegen.free_register(reg)
        #jump to function's exit
        self.codegen.unconditional_jump(self.codegen.label(self.shared.function_name+"_exit", True))
938236
def return_response(self, value=None):
        # type: (Any) -> Tuple[Callback, Return]
        """"""
        response = Return(id=self.id, value=value)
        return self.callback, response
1202764
function(object, callback) {
      return inject(object, null, function(state, key, value){
        if (state == undefined)
          return callIterator(callback, key, value) ? value : state
      })
    }
1108728
def _set_value(self, value):
        """"""
        assert not self.ready()
        self._data = value
        self._success = True
        self._event.set()
        if self._collector is not None:
            self._collector.notify_ready(self)
        if self._callback is not None:
            try:
                self._callback(value)
            except:
                traceback.print_exc()
4988
def on_success(self, fn, *args, **kwargs):
        

        self._callbacks.append((fn, args, kwargs))

        result = self._resulted_in
        if result is not _NOTHING_YET:
            self._succeed(result=result)
1195193
def callback(self, callback, *args, **kwds):
        
        return self << _CloseDummy(callback, args, kwds)
179626
def wait_return(self, callback):
        """"""
        if self.check_recv():
            return callback(self)
        _t = threading.Thread(target=self._wait_non_ressources, args=(callback,))  # noqa: E501
        _t.setDaemon(True)
        _t.start()
792273
private static function _execute($array, callable $callback, callable $handler, $data = null, $bind = false)
    {
        $resultValue = array();
        foreach ($array as $key => $item) {
            if (is_object($item)) {
                $item = clone $item;
                if ($callback instanceof \Closure and $bind) {
                    $callback = \Closure::bind($callback, $item);
                }
            }
            $result = call_user_func_array($callback, array($key, &$item, $data));
            if (call_user_func_array($handler, array(&$resultValue, $key, $item, $result)) === false) {
                break;
            }
        }
        return $resultValue;
    }
620557
function when(value, fulfilled, rejected) {
        var defer = new Defer(), done = 0;    // wrap user's callback to catch exception
        // wrap user's callback to catch exception
        function _fulfilled(value) {
            try {
                return fulfilled ? fulfilled.call(this, value) : // propagate
                value;
            } catch (e) {
                // can not use logger.error
                // must expose to user
                // print stack info for firefox/chrome
                logError(e.stack || e);
                return new Reject(e);
            }
        }
        function _rejected(reason) {
            try {
                return rejected ? // error recovery
                rejected.call(this, reason) : // propagate
                new Reject(reason);
            } catch (e) {
                // print stack info for firefox/chrome
                logError(e.stack || e);
                return new Reject(e);
            }
        }
        function finalFulfill(value) {
            if (done) {
                logger.error('already done at fulfilled');
                return;
            }
            if (value instanceof Promise) {
                logger.error('assert.not(value instanceof Promise) in when');
                return;
            }
            done = 1;
            defer.resolve(_fulfilled.call(this, value));
        }
        if (value instanceof Promise) {
            promiseWhen(value, finalFulfill, function (reason) {
                if (done) {
                    logger.error('already done at rejected');
                    return;
                }
                done = 1;    // _reject may return non-Reject object for error recovery
                // _reject may return non-Reject object for error recovery
                defer.resolve(_rejected.call(this, reason));
            });
        } else {
            finalFulfill(value);
        }    // chained and leveled
             // wait for value's resolve
        // chained and leveled
        // wait for value's resolve
        return defer.promise;
    }
966662
def call_eval(self, value, caller, return_value=True, **kwargs):
        
        value = self.name_to_system_object(value)
        if return_value and isinstance(value, AbstractStatusObject):
            return value.status
        if hasattr(value, 'call'):
            return self.call_eval(value.call(caller, **kwargs), caller, return_value, **kwargs)
        else:
            return value