Skip to content

Commit

Permalink
Rely on _cgo_export.h instead of inlined extern references.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommie committed Oct 13, 2021
1 parent 678b00c commit d7fb5d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions v8go.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct _EXCEPTION_POINTERS;

#include "libplatform/libplatform.h"
#include "v8.h"
#include "_cgo_export.h"

using namespace v8;

Expand Down Expand Up @@ -287,7 +288,6 @@ static void FunctionTemplateCallback(const FunctionCallbackInfo<Value>& info) {
// we can use the context registry to match the Context on the Go side
Local<Context> local_ctx = iso->GetCurrentContext();
int ctx_ref = local_ctx->GetEmbedderData(1).As<Integer>()->Value();
ContextPtr goContext(int ctxref);
m_ctx* ctx = goContext(ctx_ref);

int callback_ref = info.Data().As<Integer>()->Value();
Expand All @@ -311,8 +311,6 @@ static void FunctionTemplateCallback(const FunctionCallbackInfo<Value>& info) {
args[i] = tracked_value(ctx, val);
}

ValuePtr goFunctionCallback(int ctxref, int cbref,
const ValuePtr* thisAndArgs, int args_count);
ValuePtr val =
goFunctionCallback(ctx_ref, callback_ref, thisAndArgs, args_count);
if (val != nullptr) {
Expand Down

0 comments on commit d7fb5d5

Please sign in to comment.