simple.patch

simple patch, but goes 5 if-statements deep - Sam Rawlins, 07/21/2013 03:08 PM

Download (1.35 KB)

View differences:

test/ruby/test_method.rb
508 508
    assert_equal(File.dirname(File.realpath(__FILE__)), __dir__)
509 509
    bug8436 = '[ruby-core:55123] [Bug #8436]'
510 510
    assert_equal(__dir__, eval("__dir__", binding), bug8436)
511
    assert_equal("arbitrary",
512
                 eval("__dir__", binding, File.join("arbitrary", "file.rb")),
513
                 bug8436)
511 514
  end
512 515

  
513 516
  def test_alias_owner
vm_eval.c
1198 1198
	    if (rb_obj_is_kind_of(scope, rb_cBinding)) {
1199 1199
		GetBindingPtr(scope, bind);
1200 1200
		envval = bind->env;
1201
		if (strcmp(file, "(eval)") == 0 && bind->path != Qnil) {
1202
		    file = RSTRING_PTR(bind->path);
1203
		    line = bind->first_lineno;
1204
		    absolute_path = rb_current_realfilepath();
1201
		if (strcmp(file, "(eval)") == 0) {
1202
		    if (bind->path != Qnil) {
1203
			file = RSTRING_PTR(bind->path);
1204
			line = bind->first_lineno;
1205
			absolute_path = rb_current_realfilepath();
1206
		    }
1205 1207
		}
1208
                else {
1209
		    absolute_path = rb_str_new2(file);
1210
                }
1206 1211
	    }
1207 1212
	    else {
1208 1213
		rb_raise(rb_eTypeError,