Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -324,6 +324,9 @@ public void initialize() {
initializeGlobalVariables();
initializeConstants();
initializeEncodingConstants();

// Common symbols
eachSymbol = getContext().getSymbolTable().getSymbol("each");
}

private void initializeGlobalVariables() {
@@ -412,10 +415,6 @@ private RubyModule defineModule(RubyModule lexicalParent, String name) {
}

public void initializeAfterMethodsAdded() {
// Common symbols

eachSymbol = getContext().getSymbolTable().getSymbol("each");

// Load Ruby core

if (Options.TRUFFLE_LOAD_CORE.load()) {

2 comments on commit 326fedc

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

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

For non-obvious things, maybe having a second comment explaining why you're making a particular change, and not just what you're changing, would be helpful.

@eregon
Copy link
Member Author

@eregon eregon commented on 326fedc Feb 9, 2015

Choose a reason for hiding this comment

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

In this case it is to initialize earlier, which means getters of eachSymbol have less chance to see it as nil.

Please sign in to comment.