Skip to content

Commit

Permalink
fix: fix issue with preRelease in registerPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jan 26, 2025
1 parent 9dd1d6a commit fdc7447
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/legacy/api/LlAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ Local<Value> LlClass::getVersionStatus() {
}

Local<Value> LlClass::registerPlugin(const Arguments& args) {
CHECK_ARGS_COUNT(args, 1);
CHECK_ARG_TYPE(args[0], ValueKind::kString);
if (args.size() == 0) {
return Boolean::newBoolean(true);
} else {
CHECK_ARG_TYPE(args[0], ValueKind::kString);
}
if (args.size() >= 2) CHECK_ARG_TYPE(args[1], ValueKind::kString);
// if (args.size() >= 3)
// CHECK_ARG_TYPE(args[2], ValueKind::kObject);
if (args.size() >= 4) CHECK_ARG_TYPE(args[3], ValueKind::kObject);

try {
Expand All @@ -166,9 +167,11 @@ Local<Value> LlClass::registerPlugin(const Arguments& args) {
if (status.isNumber()) {
switch (status.asNumber().toInt32()) {
case 0:
ver.preRelease = ll::data::PreRelease();
ver.preRelease->from_string("dev");
break;
case 1:
ver.preRelease = ll::data::PreRelease();
ver.preRelease->from_string("beta");
break;
default:
Expand All @@ -195,9 +198,11 @@ Local<Value> LlClass::registerPlugin(const Arguments& args) {
if (status.isNumber()) {
switch (status.asNumber().toInt32()) {
case 0:
ver.preRelease = ll::data::PreRelease();
ver.preRelease->from_string("dev");
break;
case 1:
ver.preRelease = ll::data::PreRelease();
ver.preRelease->from_string("beta");
break;
default:
Expand Down

0 comments on commit fdc7447

Please sign in to comment.