You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRInterop.java
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -118,12 +118,6 @@ public static void testingMode() {
118
118
isTesting = true;
119
119
}
120
120
121
-
privatestaticvoidcheckPolyglotAccess(Envenv) {
122
-
if (!env.isPolyglotAccessAllowed()) {
123
-
throwRError.error(RError.SHOW_CALLER, RError.Message.GENERIC, "Polyglot bindings are not accessible for this language. Use --polyglot or allowPolyglotAccess when building the context.");
Copy file name to clipboardExpand all lines: com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RError.java
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1032,7 +1032,8 @@ public enum Message {
1032
1032
"SET_ATTRIB: tag in the attributes pairlist must be a symbol. %s given. It is possible that the code intends to set the TAG after the call to SET_ATTRIB, but this is not supported in FastR."),
1033
1033
WRONG_ARGS_COMBINATION("Wrong arguments combination, please refer to ?%s for more details."),
1034
1034
COULD_NOT_FIND_LANGUAGE("Could not find language corresponding to extension '%s', you can specify the language id explicitly, please refer to ?%s for more details."),
1035
-
LANGUAGE_NOT_AVAILABLE("Language with id '%s' is not available. Did you start R with --polyglot?"),
1035
+
LANGUAGE_NOT_AVAILABLE("Language with id '%s' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?"),
1036
+
POLYGLOT_BINDING_NOT_AVAILABLE("Polyglot bindings are not accessible for this language. Use --polyglot or allowPolyglotAccess when building the context."),
1036
1037
NO_LANGUAGE_PROVIDED("No language id provided, please refer to ?%s for more details."),
1037
1038
NO_CODE_OR_PATH_PROVIDED("No code or path provided, please refer to ?%s for more details."),
1038
1039
LENGTH_OF_NULL_UNCHANGED("length of NULL cannot be changed"),
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("foo", "bar") :\n Language with id \'foo\' is not available. Did you start R with --polyglot?\n') } else { eval.polyglot('foo', 'bar') }
150337
+
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("foo", "bar") :\n Language with id \'foo\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\n') } else { eval.polyglot('foo', 'bar') }
150334
150338
Error in eval.polyglot("foo", "bar") :
150335
-
Language with id 'foo' is not available. Did you start R with --polyglot?
150339
+
Language with id 'foo' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("foo", , "bar") :\n Language with id \'foo\' is not available. Did you start R with --polyglot?\n') } else { eval.polyglot('foo',, 'bar') }
150342
+
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("foo", , "bar") :\n Language with id \'foo\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\n') } else { eval.polyglot('foo',, 'bar') }
150339
150343
Error in eval.polyglot("foo", , "bar") :
150340
-
Language with id 'foo' is not available. Did you start R with --polyglot?
150344
+
Language with id 'foo' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nfi", "foo.bar") :\n Language with id \'nfi\' is not available. Did you start R with --polyglot?\n') } else { eval.polyglot('nfi', 'foo.bar') }
150347
+
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nfi", "foo.bar") :\n Language with id \'nfi\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\n') } else { eval.polyglot('nfi', 'foo.bar') }
150344
150348
Error in eval.polyglot("nfi", "foo.bar") :
150345
-
Language with id 'nfi' is not available. Did you start R with --polyglot?
150349
+
Language with id 'nfi' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nfi", , "foo.bar") :\n Language with id \'nfi\' is not available. Did you start R with --polyglot?\n') } else { eval.polyglot('nfi',,'foo.bar') }
150352
+
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nfi", , "foo.bar") :\n Language with id \'nfi\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\n') } else { eval.polyglot('nfi',,'foo.bar') }
150349
150353
Error in eval.polyglot("nfi", , "foo.bar") :
150350
-
Language with id 'nfi' is not available. Did you start R with --polyglot?
150354
+
Language with id 'nfi' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot(, "bar") :\n No language id provided, please refer to ?eval.polyglot for more details.\n') } else { eval.polyglot(, 'bar') }
@@ -150369,9 +150373,9 @@ Error in eval.polyglot("js", "console.log(42)", "file.js") :
150369
150373
Wrong arguments combination, please refer to ?eval.polyglot for more details.
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nonExistentLanguage", "code") :<<<NEWLINE>>> Language with id \'nonExistentLanguage\' is not available. Did you start R with --polyglot?\n') } else { eval.polyglot('nonExistentLanguage', 'code') }
150376
+
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("nonExistentLanguage", "code") :<<<NEWLINE>>> Language with id \'nonExistentLanguage\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\n') } else { eval.polyglot('nonExistentLanguage', 'code') }
150373
150377
Error in eval.polyglot("nonExistentLanguage", "code") :
150374
-
Language with id 'nonExistentLanguage' is not available. Did you start R with --polyglot?
150378
+
Language with id 'nonExistentLanguage' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?
#if (!any(R.version$engine == "FastR")) { cat('Error in eval.polyglot("someLanguage") :<<<NEWLINE>>> No code or path provided, please refer to ?eval.polyglot for more details.\n') } else { eval.polyglot('someLanguage') }
assertTrue(message, message.contains("Language with id 'js' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?"));
99
99
}
100
-
assertTrue(message, message.contains("Polyglot bindings are not accessible for this language. Use --polyglot or allowPolyglotAccess when building the context."));
101
100
}
102
101
103
102
@Test
@@ -115,14 +114,14 @@ public void testInteropEval() {
115
114
"cat('Error in eval.polyglot(, , \"bar\") :\\n Could not find language corresponding to extension \\'bar\\', you can specify the language id explicitly, please refer to ?eval.polyglot for more details.\\n')");
116
115
// Checkstyle: resume
117
116
assertEvalFastR("eval.polyglot('foo', 'bar')",
118
-
"cat('Error in eval.polyglot(\"foo\", \"bar\") :\\n Language with id \\'foo\\' is not available. Did you start R with --polyglot?\\n')");
117
+
"cat('Error in eval.polyglot(\"foo\", \"bar\") :\\n Language with id \\'foo\\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\\n')");
"cat('Error in eval.polyglot(\"nfi\", \"foo.bar\") :\\n Language with id \\'nfi\\' is not available. Did you start R with --polyglot?\\n')");
119
+
"cat('Error in eval.polyglot(\"nfi\", \"foo.bar\") :\\n Language with id \\'nfi\\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\\n')");
121
120
// Checkstyle: stop
122
121
assertEvalFastR("eval.polyglot('foo',, 'bar')",
123
-
"cat('Error in eval.polyglot(\"foo\", , \"bar\") :\\n Language with id \\'foo\\' is not available. Did you start R with --polyglot?\\n')");
122
+
"cat('Error in eval.polyglot(\"foo\", , \"bar\") :\\n Language with id \\'foo\\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\\n')");
"cat('Error in eval.polyglot(\"nfi\", , \"foo.bar\") :\\n Language with id \\'nfi\\' is not available. Did you start R with --polyglot?\\n')");
124
+
"cat('Error in eval.polyglot(\"nfi\", , \"foo.bar\") :\\n Language with id \\'nfi\\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\\n')");
126
125
// Checkstyle: resume
127
126
}
128
127
@@ -160,7 +159,7 @@ public void testInteropEvalFile() {
"cat('Error in eval.polyglot(path = f) :\n Could not find language corresponding to extension \\'nonLanguageExtension\\', you can specify the language id explicitly, please refer to ?eval.polyglot for more details.\\n')");
"cat('Error in eval.polyglot(\"nonExistentLanguage\", \"code\") :\n Language with id \\'nonExistentLanguage\\' is not available. Did you start R with --polyglot?\\n')");
162
+
"cat('Error in eval.polyglot(\"nonExistentLanguage\", \"code\") :\n Language with id \\'nonExistentLanguage\\' is not available. Did you start R with --polyglot or use allowPolyglotAccess when building the context?\\n')");
164
163
assertEvalFastR("eval.polyglot(code='')", "cat('Error in eval.polyglot(code = \"\") :\n No language id provided, please refer to ?eval.polyglot for more details.\\n')");
165
164
assertEvalFastR("eval.polyglot(languageId='js')", "cat('Error in eval.polyglot(languageId = \"js\") :\n No code or path provided, please refer to ?eval.polyglot for more details.\\n')");
0 commit comments