Skip to content

Commit

Permalink
[Truffle] ERB doesn't work with strscan
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Mar 1, 2015
1 parent 86681e5 commit 46c9f10
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,13 @@ public RequireNode(RequireNode prev) {
public boolean require(RubyString feature) {
notDesignedForCompilation();

// 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

if (feature.toString().equals("strscan") && Truffle.getRuntime().getCallerFrame().getCallNode()
.getEncapsulatingSourceSection().getSource().getName().endsWith("erb.rb")) {
throw new RaiseException(getContext().getCoreLibrary().loadErrorCannotLoad(feature.toString(), this));
}

try {
getContext().getFeatureManager().require(null, feature.toString(), this);
} catch (IOException e) {
Expand Down

2 comments on commit 46c9f10

@chrisseaton
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. We might be able to do something similar to conditionally load hacks necessary for IRB, too.

Please sign in to comment.