BlockJumped() private méthode

Must be called on the result of RubyOps.Yield. Implements post-yield control flow operation.
Used by library methods that take a block. The binder creates an instance of BlockParam holding on RFC if necessary. A library method that creates a block yet doesn't take one needs to manage RFC on its own.
private BlockJumped ( object returnValue ) : bool
returnValue object
Résultat bool
Exemple #1
0
        public static object EvaluateInModule(RubyModule /*!*/ self, BlockParam /*!*/ block)
        {
            Assert.NotNull(self, block);

            object returnValue = EvaluateInModuleNoJumpCheck(self, block);

            block.BlockJumped(returnValue);
            return(returnValue);
        }
Exemple #2
0
        public static object EvaluateInSingleton(object self, BlockParam /*!*/ block)
        {
            // TODO: this is checked in method definition, if no method is defined it is ok.
            // => singleton is create in method definition also.
            if (!RubyUtils.CanCreateSingleton(self))
            {
                throw RubyExceptions.CreateTypeError("can't define singleton method for literals");
            }

            block.ModuleDeclaration = block.RubyContext.CreateSingletonClass(self);

            // TODO: flows Public visibility in the block
            // Flow "Singleton" method attribute? If we change method attribute
            object returnValue = RubyOps.Yield1(self, self, block);

            block.BlockJumped(returnValue);
            return(returnValue);
        }
Exemple #3
0
        public static object EvaluateInModule(RubyModule/*!*/ self, BlockParam/*!*/ block, object defaultReturnValue) {
            Assert.NotNull(self, block);

            object returnValue = EvaluateInModuleNoJumpCheck(self, block);

            if (block.BlockJumped(returnValue)) {
                return returnValue;
            }

            return defaultReturnValue;
        }
Exemple #4
0
        public static object EvaluateInSingleton(object self, BlockParam/*!*/ block) {
            // TODO: this is checked in method definition, if no method is defined it is ok.
            // => singleton is create in method definition also.
            if (!RubyUtils.CanCreateSingleton(self)) {
                throw RubyExceptions.CreateTypeError("can't define singleton method for literals");
            }

            block.ModuleDeclaration = block.RubyContext.CreateSingletonClass(self);

            // TODO: flows Public visibility in the block
            // Flow "Singleton" method attribute? If we change method attribute
            object returnValue = RubyOps.Yield1(self, self, block);
            block.BlockJumped(returnValue);
            return returnValue;
        }
Exemple #5
0
        public static object EvaluateInModule(RubyModule/*!*/ self, BlockParam/*!*/ block) {
            Assert.NotNull(self, block);

            object returnValue = EvaluateInModuleNoJumpCheck(self, block);
            block.BlockJumped(returnValue);
            return returnValue;
        }