Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ThrowException fn to the isolate #221

Merged
merged 10 commits into from
Nov 10, 2021
Prev Previous commit
Next Next commit
Pass isolate
  • Loading branch information
wisepythagoras committed Nov 7, 2021
commit f390772cf7dc6a2536a0e74b8ec5a9299a4a1cb2
2 changes: 1 addition & 1 deletion isolate.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (i *Isolate) Dispose() {
// the exception has been handled does it become legal to invoke JavaScript operations.
func (i *Isolate) ThrowException(value *Value) *Value {
return &Value{
ptr: C.ThrowException(value.ptr),
ptr: C.IsolateThrowException(i.ptr, value.ptr),
}
}

Expand Down
7 changes: 5 additions & 2 deletions v8go.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ IsolateHStatistics IsolationGetHeapStatistics(IsolatePtr iso) {

/********** Exceptions & Errors **********/

ValuePtr ThrowException(ValuePtr value) {
Isolate* iso = value->iso;
ValuePtr IsolateThrowException(IsolatePtr iso, ValuePtr value) {
if (iso == nullptr) {
return nullptr;
}
dylanahsmith marked this conversation as resolved.
Show resolved Hide resolved

m_ctx* ctx = value->ctx;
wisepythagoras marked this conversation as resolved.
Show resolved Hide resolved

ISOLATE_SCOPE(iso);
Expand Down
2 changes: 1 addition & 1 deletion v8go.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ extern void IsolateTerminateExecution(IsolatePtr ptr);
extern int IsolateIsExecutionTerminating(IsolatePtr ptr);
extern IsolateHStatistics IsolationGetHeapStatistics(IsolatePtr ptr);

extern ValuePtr ThrowException(ValuePtr value);
extern ValuePtr IsolateThrowException(IsolatePtr iso, ValuePtr value);

extern CPUProfiler* NewCPUProfiler(IsolatePtr iso_ptr);
extern void CPUProfilerDispose(CPUProfiler* ptr);
Expand Down