diff options
-rw-r--r-- | compile.c | 1 | ||||
-rw-r--r-- | test/ruby/test_defined.rb | 12 |
2 files changed, 13 insertions, 0 deletions
@@ -5951,6 +5951,7 @@ defined_expr0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, case NODE_IASGN: case NODE_CDECL: case NODE_CVASGN: expr_type = DEFINED_ASGN; break; } @@ -127,6 +127,18 @@ class TestDefined < Test::Unit::TestCase assert_equal nil, defined?($2) end def test_defined_literal assert_equal("nil", defined?(nil)) assert_equal("true", defined?(true)) |