Skip to content

Commit 09153fb

Browse files
committed
Remove check for strscan in Kernel#require
PullRequest: truffleruby/700
2 parents 7d9583d + 74185ca commit 09153fb

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

src/main/java/org/truffleruby/core/kernel/KernelNodes.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
import org.truffleruby.language.WarnNode;
101101
import org.truffleruby.language.arguments.ReadCallerFrameNode;
102102
import org.truffleruby.language.arguments.RubyArguments;
103-
import org.truffleruby.language.backtrace.Activation;
104103
import org.truffleruby.language.backtrace.Backtrace;
105104
import org.truffleruby.language.control.RaiseException;
106105
import org.truffleruby.language.dispatch.CallDispatchHeadNode;
@@ -1372,32 +1371,10 @@ public RubyNode coerceFeatureToPath(RubyNode feature) {
13721371
@Specialization(guards = "isRubyString(featureString)")
13731372
public boolean require(DynamicObject featureString,
13741373
@Cached("create()") RequireNode requireNode) {
1375-
13761374
String feature = StringOperations.getString(featureString);
1377-
1378-
// TODO CS 1-Mar-15 ERB will use strscan if it's there, but strscan is not yet complete, so we need to hide it
1379-
if (feature.equals("strscan") && callerIs("mri/erb.rb")) {
1380-
throw new RaiseException(getContext(), coreExceptions().loadErrorCannotLoad(feature, this));
1381-
}
1382-
13831375
return requireNode.executeRequire(feature);
13841376
}
13851377

1386-
@TruffleBoundary
1387-
private boolean callerIs(String caller) {
1388-
final Backtrace backtrace = getContext().getCallStack().getBacktrace(this);
1389-
1390-
for (Activation activation : backtrace.getActivations()) {
1391-
final Node callNode = activation.getCallNode();
1392-
final Source source = callNode == null ? null : callNode.getEncapsulatingSourceSection().getSource();
1393-
1394-
if (source != null && source.getName().endsWith(caller)) {
1395-
return true;
1396-
}
1397-
}
1398-
1399-
return false;
1400-
}
14011378
}
14021379

14031380
@CoreMethod(names = "require_relative", isModuleFunction = true, required = 1)

test/mri/excludes/TestFiber.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
exclude :test_gc_root_fiber, "RubyVM-specific"
77
exclude :test_many_fibers_with_threads, "needs investigation"
88
exclude :test_to_s, "needs investigation"
9+
exclude :test_machine_stack_gc, "spurious"

tool/parse_mri_errors.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# cd test/mri
99
# ruby ../../tool/parse_mri_errors.rb output.txt
1010

11+
REASON = ENV.fetch('REASON', 'needs investigation')
12+
1113
contents = ARGF.read
1214

1315
load_error_output = "0 tests, 0 assertions, 0 failures, 0 errors, 0 skips"
@@ -52,7 +54,7 @@
5254
unless result == "."
5355
FileUtils.mkdir_p(File.dirname(file))
5456
File.open(file, 'a') do |f|
55-
f.puts "exclude #{test_method.strip.to_sym.inspect}, \"needs investigation\""
57+
f.puts "exclude #{test_method.strip.to_sym.inspect}, #{REASON.inspect}"
5658
end
5759
end
5860
end

0 commit comments

Comments
 (0)