mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-26 16:09:37 -05:00
SnapshotCreator::GetIsolate()
should have been a const method (#432)
This commit is contained in:
parent
954163ab07
commit
d84be8ca2a
2 changed files with 8 additions and 3 deletions
|
@ -1430,8 +1430,11 @@ void v8__SnapshotCreator__DESTRUCT(v8::SnapshotCreator* self) {
|
||||||
|
|
||||||
void v8__StartupData__DESTRUCT(v8::StartupData* self) { delete[] self->data; }
|
void v8__StartupData__DESTRUCT(v8::StartupData* self) { delete[] self->data; }
|
||||||
|
|
||||||
v8::Isolate* v8__SnapshotCreator__GetIsolate(v8::SnapshotCreator* self) {
|
v8::Isolate* v8__SnapshotCreator__GetIsolate(const v8::SnapshotCreator& self) {
|
||||||
return self->GetIsolate();
|
// `v8::SnapshotCreator::GetIsolate()` is not declared as a const method, but
|
||||||
|
// this appears to be a mistake.
|
||||||
|
auto self_ptr = const_cast<v8::SnapshotCreator*>(&self);
|
||||||
|
return self_ptr->GetIsolate();
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::StartupData SerializeInternalFields(v8::Local<v8::Object> holder, int index,
|
v8::StartupData SerializeInternalFields(v8::Local<v8::Object> holder, int index,
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
);
|
);
|
||||||
fn v8__SnapshotCreator__DESTRUCT(this: *mut SnapshotCreator);
|
fn v8__SnapshotCreator__DESTRUCT(this: *mut SnapshotCreator);
|
||||||
fn v8__SnapshotCreator__GetIsolate(
|
fn v8__SnapshotCreator__GetIsolate(
|
||||||
this: *mut SnapshotCreator,
|
this: *const SnapshotCreator,
|
||||||
) -> *mut Isolate;
|
) -> *mut Isolate;
|
||||||
fn v8__SnapshotCreator__CreateBlob(
|
fn v8__SnapshotCreator__CreateBlob(
|
||||||
this: *mut SnapshotCreator,
|
this: *mut SnapshotCreator,
|
||||||
|
@ -33,6 +33,8 @@ extern "C" {
|
||||||
fn v8__StartupData__DESTRUCT(this: *mut StartupData);
|
fn v8__StartupData__DESTRUCT(this: *mut StartupData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(piscisaureus): merge this struct with
|
||||||
|
// `isolate_create_params::raw::StartupData`.
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct StartupData {
|
pub struct StartupData {
|
||||||
data: *const char,
|
data: *const char,
|
||||||
|
|
Loading…
Reference in a new issue