GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Match MRI for "assigned but unused variable" warnings by sampokuokkanen · Pull Request #10046 · jruby/jruby Conversation
Contributor
With
Two causes:
This un-excludes
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsThe top-level scope is never popped, so warnUnusedVariables never ran
for it, and unused top-level variables were never reported. Report them
from finalizeDynamicScope instead, using the lexer's file because a
reused TOPLEVEL_BINDING scope has no file of its own.
pushBlockScope and pushLocalScope set warnOnUnusedVariables from
isVerbose() alone. That dropped the eval and -e exception that
initTopLocalVariables had just set up, and popCurrentScope never
restored the old value. As in MRI's dyna_push, a block now keeps the
setting of its enclosing scope, and a local scope saves the old setting
and restores it when popped.
With -w, now matching CRuby:
ruby -w script.rb (top-level a = 1) now warns (was silent),
also for required files
echo 'a = 1' | ruby -w - now warns (was silent)
ruby -we "1.times do\n a = 1\nend" now silent (was warning)
eval("1.times do\n a = 1\nend") now silent (was warning)
Unexcludes TestRubyOptions#test_unused_variable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |