示例#1
0
  private boolean moduleFunctionFlag(VirtualFrame frame) {
    final FrameSlot moduleFunctionFlagSlot =
        frame.getFrameDescriptor().findFrameSlot(RubyModule.MODULE_FUNCTION_FLAG_FRAME_SLOT_ID);

    if (moduleFunctionFlagSlot == null) {
      return false;
    } else {
      Object moduleFunctionObject;

      try {
        moduleFunctionObject = frame.getObject(moduleFunctionFlagSlot);
      } catch (FrameSlotTypeException e) {
        throw new RuntimeException(e);
      }

      return (moduleFunctionObject instanceof Boolean) && (boolean) moduleFunctionObject;
    }
  }