|
100 | 100 | import org.truffleruby.language.WarnNode;
|
101 | 101 | import org.truffleruby.language.arguments.ReadCallerFrameNode;
|
102 | 102 | import org.truffleruby.language.arguments.RubyArguments;
|
103 |
| -import org.truffleruby.language.backtrace.Activation; |
104 | 103 | import org.truffleruby.language.backtrace.Backtrace;
|
105 | 104 | import org.truffleruby.language.control.RaiseException;
|
106 | 105 | import org.truffleruby.language.dispatch.CallDispatchHeadNode;
|
@@ -1372,32 +1371,10 @@ public RubyNode coerceFeatureToPath(RubyNode feature) {
|
1372 | 1371 | @Specialization(guards = "isRubyString(featureString)")
|
1373 | 1372 | public boolean require(DynamicObject featureString,
|
1374 | 1373 | @Cached("create()") RequireNode requireNode) {
|
1375 |
| - |
1376 | 1374 | 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 |
| - |
1383 | 1375 | return requireNode.executeRequire(feature);
|
1384 | 1376 | }
|
1385 | 1377 |
|
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 |
| - } |
1401 | 1378 | }
|
1402 | 1379 |
|
1403 | 1380 | @CoreMethod(names = "require_relative", isModuleFunction = true, required = 1)
|
|
0 commit comments