Skip to content

Commit 8ec0757

Browse files
committed
Core methods written in Java should always be considered internal
* Otherwise TruffleStackTrace with a limit would count those methods towards the limit and we could not give them a proper file and line in Ruby backtraces and caller_locations.
1 parent 2930581 commit 8ec0757

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/org/truffleruby/core/CoreLibrary.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public class CoreLibrary {
123123
private final RubyContext context;
124124
private final RubyLanguage language;
125125

126-
public final SourceSection sourceSection;
126+
public final SourceSection sourceSection = initCoreSourceSection();
127127

128128
public final RubyClass argumentErrorClass;
129129
public final RubyClass arrayClass;
@@ -261,14 +261,11 @@ public class CoreLibrary {
261261
public final String corePath;
262262

263263
@TruffleBoundary
264-
private SourceSection initCoreSourceSection(RubyContext context) {
264+
private SourceSection initCoreSourceSection() {
265265
final Source.SourceBuilder builder = Source.newBuilder(TruffleRuby.LANGUAGE_ID, "", "(core)");
266-
if (context.getOptions().CORE_AS_INTERNAL) {
267-
builder.internal(true);
268-
}
266+
builder.internal(true);
269267

270268
final Source source;
271-
272269
try {
273270
source = builder.build();
274271
} catch (IOException e) {
@@ -311,7 +308,6 @@ public CoreLibrary(RubyContext context, RubyLanguage language) {
311308
this.language = language;
312309
this.coreLoadPath = buildCoreLoadPath();
313310
this.corePath = coreLoadPath + File.separator + "core" + File.separator;
314-
this.sourceSection = initCoreSourceSection(context);
315311
this.node = SingletonClassNode.getUncached();
316312

317313
// Nothing in this constructor can use RubyContext.getCoreLibrary() as we are building it!

0 commit comments

Comments
 (0)