File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,11 @@ NAN_METHOD(getOption) {
304304 if (info.Length () > 0 ) {
305305 Local<String> value = info[0 ]->ToString ();
306306 std::string property = loaderApi->getProperty (toStdString (value).c_str ());
307+ #if NODE_VERSION_AT_LEAST(0, 11, 0) // > v0.11+
307308 v8::Local<v8::String> v8str = v8::String::NewFromUtf8 (v8::Isolate::GetCurrent (), property.c_str ());
309+ #else
310+ v8::Local<v8::String> v8str = v8::String::New (property.c_str (), strlen (property.c_str ()));
311+ #endif
308312 info.GetReturnValue ().Set <v8::String>(v8str);
309313 } else {
310314 loaderApi->logMessage (warning, " Incorrect number of parameters passed to getOption" );
@@ -331,8 +335,10 @@ NAN_METHOD(start) {
331335NAN_METHOD (stop) {
332336
333337 if (running) {
338+ printf (" running" );
334339 running = false ;
335340 loaderApi->stop ();
341+ printf (" stopped loaderApi" );
336342 loaderApi->shutdown ();
337343 headless::stop ();
338344 }
Original file line number Diff line number Diff line change @@ -33,10 +33,18 @@ uv_async_t async_zip;
3333uv_loop_t * loop;
3434const char * outputDir;
3535
36+ #if NODE_VERSION_AT_LEAST(0, 11, 0) // > v0.11+
3637void asyncfunc (uv_async_t * handle) {
38+ #else
39+ void asyncfunc (uv_async_t * handle, int status) {
40+ #endif
3741 Nan::HandleScope scope;
3842 v8::Isolate* isolate = v8::Isolate::GetCurrent ();
39- v8::Local<v8::Value> argv[] = { v8::String::NewFromUtf8 (isolate, outputDir) };
43+ #if NODE_VERSION_AT_LEAST(0, 11, 0) // > v0.11+
44+ v8::Local<v8::Value> argv[] = { v8::String::NewFromUtf8 (isolate, outputDir) };
45+ #else
46+ v8::Local<v8::Value> argv[] = { v8::String::New (outputDir, strlen (outputDir)) };
47+ #endif
4048 headless::zipFunction->Call (1 , argv);
4149}
4250
@@ -49,7 +57,9 @@ void start() {
4957}
5058
5159void stop () {
60+ printf (" >> stop" );
5261 uv_close ((uv_handle_t *) &async_zip, NULL );
62+ printf (" << stop" );
5363}
5464
5565void zip (const char * dir) {
You can’t perform that action at this time.
0 commit comments