diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-14 14:09:56 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-08-14 14:09:56 +0900 |
| commit | 603005ba6508da59220a4c7385a0c98bda78a201 (patch) | |
| tree | 80d94f73726a2e31ac89597b8ea2c2393a85395f /mrblib | |
| parent | 8ed15fd92e6d3ce7963db8c3162bdebee7b55e1b (diff) | |
| download | mruby-603005ba6508da59220a4c7385a0c98bda78a201.tar.gz mruby-603005ba6508da59220a4c7385a0c98bda78a201.zip | |
Integrate `kazuho/mruby-class-new-fiber-safe` in the master.
Avoid calling `initialize` via `mrb_funcall`, which cause `cross C
boundary` error from Fibers started in the method.
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/00class.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrblib/00class.rb b/mrblib/00class.rb index 1811236f0..8fcfb1362 100644 --- a/mrblib/00class.rb +++ b/mrblib/00class.rb @@ -1,3 +1,11 @@ +class Class + def new(*args, &block) + obj = self.allocate + obj.initialize(*args, &block) + obj + end +end + class Module # 15.2.2.4.12 def attr_accessor(*names) |
