Package org.jruby.truffle.runtime.control

Examples of org.jruby.truffle.runtime.control.RaiseException


        final Object childValue = child.execute(frame);

        if (!(childValue instanceof RubyMatchData || childValue instanceof RubyNilClass || childValue instanceof RubyNilClass)) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(getContext().getCoreLibrary().typeError("wrong argument type (expected MatchData)", this));
        }

        return childValue;
    }
View Full Code Here


            case CALL_CONST_MISSING: {
                final RubyMethod method = lookup(callerClass, receiverObject, "const_missing", ignoreVisibility, dispatchAction);

                if (method == null) {
                    throw new RaiseException(getContext().getCoreLibrary().runtimeError(
                            receiverObject.toString() + " didn't have a #const_missing", this));
                }

                if (Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED.load()) {
                    return first.replace(UncachedDispatchNodeFactory.create(getContext(), ignoreVisibility,
View Full Code Here

            case CALL_METHOD_MISSING: {
                final RubyMethod method = lookup(null, receiverObject, "method_missing", true, dispatchAction);

                if (method == null) {
                    throw new RaiseException(getContext().getCoreLibrary().runtimeError(
                            receiverObject.toString() + " didn't have a #method_missing", this));
                }

                if (Options.TRUFFLE_DISPATCH_METAPROGRAMMING_ALWAYS_UNCACHED.load()) {
                    return first.replace(UncachedDispatchNodeFactory.create(getContext(), ignoreVisibility,
View Full Code Here

    }

    public void executeVoid(VirtualFrame frame) {
        value.executeVoid(frame);
        CompilerDirectives.transferToInterpreter();
        throw new RaiseException(getContext().getCoreLibrary().nameErrorReadOnly(name, this));
    }
View Full Code Here

    public static long convertToLong(RubyNode currentNode, DispatchHeadNode dispatch, VirtualFrame frame, RubyObject object) {
        try {
            return dispatch.callLongFixnum(frame, object, "to_i", null);
        } catch (UseMethodMissingException e) {
            throw new RaiseException(currentNode.getContext().getCoreLibrary().typeErrorCantConvertInto(object.getLogicalClass().getName(),
                    currentNode.getContext().getCoreLibrary().getIntegerClass().getName(), currentNode));
        }
    }
View Full Code Here

        if (value instanceof UndefinedPlaceholder) {
            hasSeenUndefined = true;
            return value;
        }

        throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
                value, getContext().getCoreLibrary().getIntegerClass(), this));
    }
View Full Code Here

    public Object execute(VirtualFrame frame) {
        try {
            return body.execute(frame);
        } catch (RetryException e) {
            CompilerDirectives.transferToInterpreter();
            throw new RaiseException(getContext().getCoreLibrary().syntaxError("Invalid retry", this));
        }
    }
View Full Code Here

        if (constant == null) {
            return null;
        }

        if (!ignoreVisibility && !constant.isVisibleTo(getContext(), lexicalScope, module)) {
            throw new RaiseException(getContext().getCoreLibrary().nameErrorPrivateConstant(module, name, this));
        }

        return constant;
    }
View Full Code Here

        }

        // Check for methods that are explicitly undefined

        if (method.isUndefined()) {
            throw new RaiseException(getContext().getCoreLibrary().noMethodError(name, receiver.toString(), this));
        }

        // Check visibility

        if (!ignoreVisibility && !method.isVisibleTo(this, callerClass)) {
            if (dispatchAction == Dispatch.DispatchAction.CALL_METHOD) {
                throw new RaiseException(getContext().getCoreLibrary().privateMethodError(name, receiver.toString(), this));
            } else if (dispatchAction == Dispatch.DispatchAction.RESPOND_TO_METHOD) {
                return null;
            } else {
                throw new UnsupportedOperationException();
            }
View Full Code Here

                context.getCoreLibrary().getFloatClass().getName(),
                receiverBoxed.getLogicalClass().getName(),
                methodName,
                valueBoxed.getLogicalClass().getName());

        throw new RaiseException(context.getCoreLibrary().typeErrorCantConvertTo(
                receiverBoxed.getLogicalClass().getName(),
                message,
                this));
    }
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.control.RaiseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.