Skip to content

Commit

Permalink
[Truffle] Fix require_relative when used inside eval/class_eval/insta…
Browse files Browse the repository at this point in the history
…nce_eval.
  • Loading branch information
eregon committed Nov 11, 2016
1 parent a9cda09 commit 16948e2
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -1495,7 +1495,12 @@ private String getFullPath(final String featureString) {
featurePath = featureString;
} else {
final Source source = getContext().getCallStack().getCallerFrameIgnoringSend().getCallNode().getEncapsulatingSourceSection().getSource();
final String sourcePath = source.getPath();

String sourcePath = source.getPath();
if (sourcePath == null) {
// Use the filename passed to eval as basepath
sourcePath = source.getName();
}

if (sourcePath == null) {
throw new RaiseException(coreExceptions().loadError("cannot infer basepath", featureString, this));
Expand Down

0 comments on commit 16948e2

Please sign in to comment.