Project

General

Profile

Feature #9107 ยป yes-no.patch

gsamokovarov (Genadi Samokovarov), 11/13/2013 11:36 PM

View differences:

object.c
3311 3311
    rb_undef_alloc_func(rb_cTrueClass);
3312 3312
    rb_undef_method(CLASS_OF(rb_cTrueClass), "new");
3313 3313
    /*
3314
     * An alias of +true+
3314
     * Aliases of +true+
3315 3315
     */
3316 3316
    rb_define_global_const("TRUE", Qtrue);
3317
    rb_define_global_const("YES", Qtrue);
3317 3318

  
3318 3319
    rb_cFalseClass = rb_define_class("FalseClass", rb_cObject);
3319 3320
    rb_define_method(rb_cFalseClass, "to_s", false_to_s, 0);
......
3324 3325
    rb_undef_alloc_func(rb_cFalseClass);
3325 3326
    rb_undef_method(CLASS_OF(rb_cFalseClass), "new");
3326 3327
    /*
3327
     * An alias of +false+
3328
     * Aliases of +false+
3328 3329
     */
3329 3330
    rb_define_global_const("FALSE", Qfalse);
3331
    rb_define_global_const("NO", Qfalse);
3330 3332

  
3331 3333
    for (i=0; conv_method_names[i].method; i++) {
3332 3334
	conv_method_names[i].id = rb_intern(conv_method_names[i].method);
test/ruby/test_eval.rb
253 253
    assert(!bad)
254 254

  
255 255
    assert(eval('TRUE'))
256
    assert(eval('YES'))
256 257
    assert(eval('true'))
257 258
    assert(!eval('NIL'))
258 259
    assert(!eval('nil'))
259 260
    assert(!eval('FALSE'))
261
    assert(!eval('NO'))
260 262
    assert(!eval('false'))
261 263

  
262 264
    $foo = 'assert(true)'
263
-