@@ -423,27 +423,29 @@ static void OpenDirSync(const FunctionCallbackInfo<Value>& args) { |
423 | 423 | args.GetReturnValue().Set(handle->object().As<Value>()); |
424 | 424 | } |
425 | 425 |
|
426 | | -void Initialize(Local<Object> target, |
427 | | - Local<Value> unused, |
428 | | - Local<Context> context, |
429 | | - void* priv) { |
430 | | - Environment* env = Environment::GetCurrent(context); |
431 | | - Isolate* isolate = env->isolate(); |
| 426 | +void CreatePerIsolateProperties(IsolateData* isolate_data, |
| 427 | + Local<ObjectTemplate> target) { |
| 428 | + Isolate* isolate = isolate_data->isolate(); |
432 | 429 |
|
433 | | - SetMethod(context, target, "opendir", OpenDir); |
434 | | - SetMethod(context, target, "opendirSync", OpenDirSync); |
| 430 | + SetMethod(isolate, target, "opendir", OpenDir); |
| 431 | + SetMethod(isolate, target, "opendirSync", OpenDirSync); |
435 | 432 |
|
436 | 433 | // Create FunctionTemplate for DirHandle |
437 | 434 | Local<FunctionTemplate> dir = NewFunctionTemplate(isolate, DirHandle::New); |
438 | | - dir->Inherit(AsyncWrap::GetConstructorTemplate(env)); |
| 435 | + dir->Inherit(AsyncWrap::GetConstructorTemplate(isolate_data)); |
439 | 436 | SetProtoMethod(isolate, dir, "read", DirHandle::Read); |
440 | 437 | SetProtoMethod(isolate, dir, "close", DirHandle::Close); |
441 | 438 | Local<ObjectTemplate> dirt = dir->InstanceTemplate(); |
442 | 439 | dirt->SetInternalFieldCount(DirHandle::kInternalFieldCount); |
443 | | - SetConstructorFunction(context, target, "DirHandle", dir); |
444 | | - env->set_dir_instance_template(dirt); |
| 440 | + SetConstructorFunction(isolate, target, "DirHandle", dir); |
| 441 | + isolate_data->set_dir_instance_template(dirt); |
445 | 442 | } |
446 | 443 |
|
| 444 | +void CreatePerContextProperties(Local<Object> target, |
| 445 | + Local<Value> unused, |
| 446 | + Local<Context> context, |
| 447 | + void* priv) {} |
| 448 | + |
447 | 449 | void RegisterExternalReferences(ExternalReferenceRegistry* registry) { |
448 | 450 | registry->Register(OpenDir); |
449 | 451 | registry->Register(OpenDirSync); |
@@ -456,6 +458,8 @@ void RegisterExternalReferences(ExternalReferenceRegistry* registry) { |
456 | 458 |
|
457 | 459 | } // end namespace node |
458 | 460 |
|
459 | | -NODE_BINDING_CONTEXT_AWARE_INTERNAL(fs_dir, node::fs_dir::Initialize) |
| 461 | +NODE_BINDING_CONTEXT_AWARE_INTERNAL(fs_dir, |
| 462 | + node::fs_dir::CreatePerContextProperties) |
| 463 | +NODE_BINDING_PER_ISOLATE_INIT(fs_dir, node::fs_dir::CreatePerIsolateProperties) |
460 | 464 | NODE_BINDING_EXTERNAL_REFERENCE(fs_dir, |
461 | 465 | node::fs_dir::RegisterExternalReferences) |