diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-09 22:25:45 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-09 22:25:45 +0900 |
| commit | 53f750dbed85bdf7342d5c4b1bc013c3169c15d6 (patch) | |
| tree | d04b3df5a85327f2385f0b3c0f08008b79f5360a /src | |
| parent | 3d3ca985b016afa7d07b59a067a661ce47b221ba (diff) | |
| download | mruby-53f750dbed85bdf7342d5c4b1bc013c3169c15d6.tar.gz mruby-53f750dbed85bdf7342d5c4b1bc013c3169c15d6.zip | |
def statement and define_method now return symbol a la Ruby2.1
Diffstat (limited to 'src')
| -rw-r--r-- | src/class.c | 2 | ||||
| -rw-r--r-- | src/codegen.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/class.c b/src/class.c index 7fc8fabbb..c10f7449b 100644 --- a/src/class.c +++ b/src/class.c @@ -1486,7 +1486,7 @@ mod_define_method(mrb_state *mrb, mrb_value self) mrb_proc_copy(p, mrb_proc_ptr(blk)); p->flags |= MRB_PROC_STRICT; mrb_define_method_raw(mrb, c, mid, p); - return blk; + return mrb_symbol_value(mid); } static void diff --git a/src/codegen.c b/src/codegen.c index 34ccd616f..9b7116168 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -2317,7 +2317,7 @@ codegen(codegen_scope *s, node *tree, int val) pop(); genop(s, MKOP_AB(OP_METHOD, cursp(), sym)); if (val) { - genop(s, MKOP_A(OP_LOADNIL, cursp())); + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), sym)); push(); } } @@ -2337,7 +2337,7 @@ codegen(codegen_scope *s, node *tree, int val) pop(); genop(s, MKOP_AB(OP_METHOD, cursp(), sym)); if (val) { - genop(s, MKOP_A(OP_LOADNIL, cursp())); + genop(s, MKOP_ABx(OP_LOADSYM, cursp(), sym)); push(); } } |
