File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,11 @@ class ConverterObject : public BaseObject, Converter {
171
171
Environment* env = Environment::GetCurrent (args);
172
172
HandleScope scope (env->isolate ());
173
173
174
+ Local<ObjectTemplate> t = ObjectTemplate::New (env->isolate ());
175
+ t->SetInternalFieldCount (1 );
176
+ Local<Object> obj;
177
+ if (!t->NewInstance (env->context ()).ToLocal (&obj)) return ;
178
+
174
179
CHECK_GE (args.Length (), 2 );
175
180
Utf8Value label (env->isolate (), args[0 ]);
176
181
int flags = args[1 ]->Uint32Value (env->context ()).ToChecked ();
@@ -190,9 +195,6 @@ class ConverterObject : public BaseObject, Converter {
190
195
nullptr , nullptr , nullptr , &status);
191
196
}
192
197
193
- Local<ObjectTemplate> t = ObjectTemplate::New (env->isolate ());
194
- t->SetInternalFieldCount (1 );
195
- Local<Object> obj = t->NewInstance (env->context ()).ToLocalChecked ();
196
198
new ConverterObject (env, obj, conv, ignoreBOM);
197
199
args.GetReturnValue ().Set (obj);
198
200
}
You can’t perform that action at this time.
0 commit comments