summaryrefslogtreecommitdiffstats
path: root/sample
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-16 13:12:24 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-16 13:12:24 +0000
commitf757326be1b2d6797e35c33d13ac8c28069fdd96 (patch)
treede246e154a39f173491d53dfed39b4ffe2615e18 /sample
parentfea9fc425513cfbcc2ae9b7c6d1387017daed143 (diff)
downloadruby-f757326be1b2d6797e35c33d13ac8c28069fdd96.tar.gz
ruby-f757326be1b2d6797e35c33d13ac8c28069fdd96.tar.xz
ruby-f757326be1b2d6797e35c33d13ac8c28069fdd96.zip
* compile.c (iseq_compile_each): fix next/redo stack consistency.
[ruby-dev:31373] * bootstraptest/test_syntax.rb: add tests for above. * sample/test.rb: fix to use __FILE__ instead of $0 to know basedir. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 6dffa609d..768429d95 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1871,13 +1871,14 @@ File.unlink "script_tmp" or `/bin/rm -f "script_tmp"`
File.unlink "script_tmp.bak" or `/bin/rm -f "script_tmp.bak"`
$bad = false
-if (dir = File.dirname(File.dirname($0))) == '.'
+if (dir = File.dirname(File.dirname(__FILE__))) == '.'
dir = ""
else
dir << "/"
end
def valid_syntax?(code, fname)
+ p fname
eval("BEGIN {return true}\n#{code}", nil, fname, 0)
rescue Exception
STDERR.puts $!.message