Skip to content

Commit

Permalink
Revert "[Truffle] Top-level methods should be public by default."
Browse files Browse the repository at this point in the history
* This reverts commit 6be4fe2.
* They should be private: $ ruby -e 'def m; end; p self.private_methods(false)'
  • Loading branch information
eregon committed Dec 30, 2014
1 parent af77cd9 commit ba273a5
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -163,7 +163,7 @@ public RubyRootNode parse(RubyNode currentNode, RubyContext context, Source sour

// Set default top-level visibility
if (parserContext == ParserContext.TOP_LEVEL) {
truffleNode = new SetFrameVisibilityNode(context, truffleNode.getSourceSection(), truffleNode, Visibility.PUBLIC);
truffleNode = new SetFrameVisibilityNode(context, truffleNode.getSourceSection(), truffleNode, Visibility.PRIVATE);
}

// Load flip-flop states
Expand Down

4 comments on commit ba273a5

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we should have a spec for this then. Reverting this change does break specs for ERB because it changes the semantics of eval. But I'm now thinking it's because our notion of top-level isn't correct.

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like non-Truffle JRuby gets this wrong, too.

@eregon
Copy link
Member Author

@eregon eregon commented on ba273a5 Dec 30, 2014

Choose a reason for hiding this comment

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

vijay4ethical/rubyspec@91ce9f6 should specify the basics of it. Behavior across files probably belongs to load or require.

@eregon
Copy link
Member Author

@eregon eregon commented on ba273a5 Dec 30, 2014

Choose a reason for hiding this comment

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

Fixed by da135d7.

Please sign in to comment.