Skip to content

Commit

Permalink
shared: Add back check whether binding export is registered already
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonMrBonnie committed Oct 18, 2023
1 parent bdce7e6 commit 4c7d7aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shared/src/modules/SharedCppBindingsModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ static void RegisterExport(js::FunctionContext& ctx)
if(!ctx.GetArg(1, value)) return;

js::IResource* resource = ctx.GetResource();
if(!ctx.Check(!resource->HasBindingExport(export_), "Binding export already registered")) return;

resource->SetBindingExport(export_, value);
}

Expand Down

0 comments on commit 4c7d7aa

Please sign in to comment.