Fix mruby bindings #197

Open
pulsejet wants to merge 5 commits from pulsejet/mrb into master
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 6fccac89e5 - Show all commits

View File

@ -71,8 +71,7 @@ static const MrbExcData excData[] =
{ Shutdown, "SystemExit" }, { Shutdown, "SystemExit" },
Ancurio commented 2018-04-29 09:26:45 +00:00 (Migrated from github.com)
Review

Why the rename? Is IOError already defined by mruby?

Why the rename? Is `IOError` already defined by mruby?
pulsejet commented 2018-04-29 12:32:43 +00:00 (Migrated from github.com)
Review

Yeah. If I remember right, this throws up some error about IOError already existing.

Yeah. If I remember right, this throws up some error about `IOError` already existing.
pulsejet commented 2018-04-29 12:42:57 +00:00 (Migrated from github.com)
Review

Should I rename this to something better?

Should I rename this to something better?
Ancurio commented 2018-05-05 09:28:45 +00:00 (Migrated from github.com)
Review

This is from the io-gem too, right. Just delete this entry in the array, and query the existing error class like done here: https://github.com/Ancurio/mkxp/blob/master/binding-mruby/binding-util.cpp#L120

This is from the io-gem too, right. Just delete this entry in the array, and query the existing error class like done here: https://github.com/Ancurio/mkxp/blob/master/binding-mruby/binding-util.cpp#L120
pulsejet commented 2018-11-25 12:14:12 +00:00 (Migrated from github.com)
Review

Did this, but tbh I've no idea what's going on here

Did this, but tbh I've no idea what's going on here
{ PHYSFS, "PHYSFSError" }, { PHYSFS, "PHYSFSError" },
{ SDL, "SDLError" }, { SDL, "SDLError" },
{ MKXP, "MKXPError" }, { MKXP, "MKXPError" }
{ IO, "IOError2" }
}; };
static elementsN(excData); static elementsN(excData);
@ -118,6 +117,7 @@ MrbData::MrbData(mrb_state *mrb)
exc[TypeError] = mrb_class_get(mrb, "TypeError"); exc[TypeError] = mrb_class_get(mrb, "TypeError");
exc[ArgumentError] = mrb_class_get(mrb, "ArgumentError"); exc[ArgumentError] = mrb_class_get(mrb, "ArgumentError");
exc[IOError] = mrb_class_get(mrb, "IOError");
for (size_t i = 0; i < symDataN; ++i) for (size_t i = 0; i < symDataN; ++i)
symbols[symData[i].ind] = mrb_intern_cstr(mrb, symData[i].str); symbols[symData[i].ind] = mrb_intern_cstr(mrb, symData[i].str);
@ -134,6 +134,7 @@ static const MrbException excToMrbExc[] =
TypeError, TypeError,
ArgumentError, ArgumentError,
IOError,
PHYSFS, /* PHYSFSError */ PHYSFS, /* PHYSFSError */
SDL, /* SDLError */ SDL, /* SDLError */

View File

@ -91,6 +91,7 @@ enum MrbException
TypeError, TypeError,
ArgumentError, ArgumentError,
IOError,
MrbExceptionsMax MrbExceptionsMax
}; };