void DateFormat::DeleteDateFormat(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param) {
// First delete the hidden C++ object.
delete reinterpret_cast<icu::SimpleDateFormat*>(Handle<JSObject>::cast(
void NumberFormat::DeleteNumberFormat(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param) {
// First delete the hidden C++ object.
delete reinterpret_cast<icu::DecimalFormat*>(Handle<JSObject>::cast(
void Collator::DeleteCollator(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param) {
// First delete the hidden C++ object.
delete reinterpret_cast<icu::Collator*>(Handle<JSObject>::cast(
// Release memory we allocated for the DateFormat once the JS object that
// holds the pointer gets garbage collected.
static void DeleteDateFormat(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param);
private:
DateFormat();
// Release memory we allocated for the NumberFormat once the JS object that
// holds the pointer gets garbage collected.
static void DeleteNumberFormat(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param);
private:
NumberFormat();
// Release memory we allocated for the Collator once the JS object that holds
// the pointer gets garbage collected.
static void DeleteCollator(v8::Isolate* isolate,
- Persistent<v8::Object>* object,
+ Persistent<v8::Value>* object,
void* param);
private:
Collator();
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
// Make object handle weak so we can delete the data format once GC kicks in.
- wrapper.MakeWeak<void>(NULL, &DateFormat::DeleteDateFormat);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ DateFormat::DeleteDateFormat);
return *local_object;
}
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
- // Make object handle weak so we can delete the number format once GC kicks
- // in.
- wrapper.MakeWeak<void>(NULL, &NumberFormat::DeleteNumberFormat);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ NumberFormat::DeleteNumberFormat);
return *local_object;
}
isolate->factory()->NewStringFromAscii(CStrVector("valid")),
NONE));
- Persistent<v8::Object> wrapper(reinterpret_cast<v8::Isolate*>(isolate),
- v8::Utils::ToLocal(local_object));
- // Make object handle weak so we can delete the collator once GC kicks in.
- wrapper.MakeWeak<void>(NULL, &Collator::DeleteCollator);
- wrapper.ClearAndLeak();
+ Handle<Object> wrapper = isolate->global_handles()->Create(*local_object);
+ GlobalHandles::MakeWeak(reinterpret_cast<Object**>(wrapper.location()),
+ NULL,
+ Collator::DeleteCollator);
return *local_object;
}