Skip to content
Snippets Groups Projects
Commit 7294bae1 authored by stepan's avatar stepan
Browse files

New builtin does not fail without --jvm

parent f9a99b21
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ import com.oracle.truffle.r.nodes.builtin.RBuiltinNode;
import com.oracle.truffle.r.runtime.FastROptions;
import com.oracle.truffle.r.runtime.RRuntime;
import com.oracle.truffle.r.runtime.builtins.RBuiltin;
import com.oracle.truffle.r.runtime.context.RContext;
import com.oracle.truffle.r.runtime.data.RNull;
/**
......@@ -48,6 +49,9 @@ public abstract class FastROptionBuiltin extends RBuiltinNode.Arg1 {
@Specialization
@TruffleBoundary
protected Object getOption(String name) {
if ("hostLookup".equals(name)) {
return RRuntime.asLogical(RContext.getInstance().getEnv().isHostLookupAllowed());
}
FastROptions opt = null;
try {
opt = Enum.valueOf(FastROptions.class, name);
......
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -25,7 +25,7 @@ eval(expression({
`slot<-` <- .fastr.methods.slotassign
new <- function (Class, ...) {
if(is.character(Class)) {
if (.fastr.option("hostLookup") && is.character(Class) && !isClass(Class)) {
javaClass <- java.type(Class, silent=TRUE)
if(!is.null(javaClass)) {
Class <- javaClass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment