aboutsummaryrefslogtreecommitdiff
path: root/src/fs_event_wrap.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2016-08-21 12:31:20 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-08-23 21:15:44 +0200
commitb4ea3a08f1507e4260f4fb1fa20a4195f5924091 (patch)
treebae27ee74c96f1b88597ed6e6cf1a1db91b1b66d /src/fs_event_wrap.cc
parenta129639eab186a5a0cb1384418938aef79a33220 (diff)
downloadandroid-node-v8-b4ea3a08f1507e4260f4fb1fa20a4195f5924091.tar.gz
android-node-v8-b4ea3a08f1507e4260f4fb1fa20a4195f5924091.tar.bz2
android-node-v8-b4ea3a08f1507e4260f4fb1fa20a4195f5924091.zip
src: clean up PER_ISOLATE_STRING_PROPERTIES, v2
Remove strings from the PER_ISOLATE_STRING_PROPERTIES list that are only used once during initialization. It's less expensive to simply create them when needed than turn them into v8::Eternal instances. PR-URL: https://github.com/nodejs/node/pull/8207 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/fs_event_wrap.cc')
-rw-r--r--src/fs_event_wrap.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index 2354a1be0c..64ff93e257 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -65,14 +65,15 @@ void FSEventWrap::Initialize(Local<Object> target,
Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
+ auto fsevent_string = FIXED_ONE_BYTE_STRING(env->isolate(), "FSEvent");
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
- t->SetClassName(env->fsevent_string());
+ t->SetClassName(fsevent_string);
env->SetProtoMethod(t, "start", Start);
env->SetProtoMethod(t, "close", Close);
- target->Set(env->fsevent_string(), t->GetFunction());
+ target->Set(fsevent_string, t->GetFunction());
}