summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-16 09:19:16 -0300
committerVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-16 09:19:16 -0300
commit85d01fba6d26d7fa1c626634af7944c2506791a0 (patch)
tree232593b835635de1b027ce8a0b3d0edf47db3f8d
parentf6a72df9d0bb1d7a79f366175d37fb04bc1be24b (diff)
[JS bindings]: restore compatibility with Ubuntu Trusty's NodeJS versiondevs/felipealmeida/js-vinicius
-rw-r--r--src/bindings/ecore_js/ecore_js_animator.cc24
-rw-r--r--src/bindings/ecore_js/ecore_js_event.cc31
-rw-r--r--src/bindings/ecore_js/ecore_js_idle.cc23
-rw-r--r--src/bindings/ecore_js/ecore_js_job.cc5
-rw-r--r--src/bindings/ecore_js/ecore_js_mainloop.cc9
-rw-r--r--src/bindings/ecore_js/ecore_js_poller.cc6
-rw-r--r--src/bindings/ecore_js/ecore_js_timer.cc13
-rw-r--r--src/bindings/eina_js/eina_js_compatibility.hh18
-rw-r--r--src/bindings/eina_js/eina_js_log.cc22
9 files changed, 92 insertions, 59 deletions
diff --git a/src/bindings/ecore_js/ecore_js_animator.cc b/src/bindings/ecore_js/ecore_js_animator.cc
index 19ae5c3..6f9d432 100644
--- a/src/bindings/ecore_js/ecore_js_animator.cc
+++ b/src/bindings/ecore_js/ecore_js_animator.cc
@@ -31,6 +31,7 @@ static v8::Local<v8::Object> wrap_animator(Ecore_Animator *animator,
31 return compatibility_return(); 31 return compatibility_return();
32 32
33 ecore_animator_del(extract_animator(info.This())); 33 ecore_animator_del(extract_animator(info.This()));
34 return compatibility_return();
34 }; 35 };
35 36
36 auto freeze = [](compatibility_callback_info_type info) 37 auto freeze = [](compatibility_callback_info_type info)
@@ -39,6 +40,7 @@ static v8::Local<v8::Object> wrap_animator(Ecore_Animator *animator,
39 return compatibility_return(); 40 return compatibility_return();
40 41
41 ecore_animator_freeze(extract_animator(info.This())); 42 ecore_animator_freeze(extract_animator(info.This()));
43 return compatibility_return();
42 }; 44 };
43 45
44 auto thaw = [](compatibility_callback_info_type info) 46 auto thaw = [](compatibility_callback_info_type info)
@@ -47,6 +49,7 @@ static v8::Local<v8::Object> wrap_animator(Ecore_Animator *animator,
47 return compatibility_return(); 49 return compatibility_return();
48 50
49 ecore_animator_thaw(extract_animator(info.This())); 51 ecore_animator_thaw(extract_animator(info.This()));
52 return compatibility_return();
50 }; 53 };
51 54
52 ret->Set(compatibility_new<String>(isolate, "del"), 55 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -226,6 +229,7 @@ void register_animator_frametime_set(v8::Isolate *isolate,
226 return compatibility_return(); 229 return compatibility_return();
227 230
228 ecore_animator_frametime_set(args[0]->NumberValue()); 231 ecore_animator_frametime_set(args[0]->NumberValue());
232 return compatibility_return();
229 }; 233 };
230 234
231 global->Set(name, 235 global->Set(name,
@@ -428,6 +432,7 @@ void register_animator_source_set(v8::Isolate *isolate,
428 } 432 }
429 433
430 ecore_animator_source_set(source); 434 ecore_animator_source_set(source);
435 return compatibility_return();
431 }; 436 };
432 437
433 global->Set(name, 438 global->Set(name,
@@ -484,9 +489,8 @@ register_animator_custom_source_tick_begin_callback_set(v8::Isolate *isolate,
484 using v8::Undefined; 489 using v8::Undefined;
485 using v8::Isolate; 490 using v8::Isolate;
486 491
487 auto isolate = Isolate::GetCurrent(); 492 auto o = animator_custom_source_tick_begin_cb_data.handle();
488 Function::Cast(*animator_custom_source_tick_begin_cb_data 493 Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
489 .handle())->Call(Undefined(isolate), 0, NULL);
490 }, NULL); 494 }, NULL);
491 }; 495 };
492 496
@@ -516,9 +520,8 @@ register_animator_custom_source_tick_end_callback_set(v8::Isolate *isolate,
516 using v8::Undefined; 520 using v8::Undefined;
517 using v8::Isolate; 521 using v8::Isolate;
518 522
519 auto isolate = Isolate::GetCurrent(); 523 auto o = animator_custom_source_tick_end_cb_data.handle();
520 Function::Cast(*animator_custom_source_tick_end_cb_data 524 Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
521 .handle())->Call(Undefined(isolate), 0, NULL);
522 }, NULL); 525 }, NULL);
523 }; 526 };
524 527
@@ -567,10 +570,9 @@ void register_animator_add(v8::Isolate *isolate, v8::Handle<v8::Object> global,
567 auto cb = [](void *data) -> Eina_Bool { 570 auto cb = [](void *data) -> Eina_Bool {
568 auto persistent 571 auto persistent
569 = reinterpret_cast<compatibility_persistent<Value>*>(data); 572 = reinterpret_cast<compatibility_persistent<Value>*>(data);
570 auto closure = Function::Cast(*persistent->handle()); 573 auto o = persistent->handle();
571 574
572 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 575 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
573 NULL);
574 auto bret = ret->IsBoolean() && ret->BooleanValue(); 576 auto bret = ret->IsBoolean() && ret->BooleanValue();
575 577
576 if (!bret) 578 if (!bret)
@@ -613,12 +615,12 @@ void register_animator_timeline_add(v8::Isolate *isolate,
613 auto cb = [](void *data, double pos) -> Eina_Bool { 615 auto cb = [](void *data, double pos) -> Eina_Bool {
614 auto persistent 616 auto persistent
615 = reinterpret_cast<compatibility_persistent<Value>*>(data); 617 = reinterpret_cast<compatibility_persistent<Value>*>(data);
616 auto closure = Function::Cast(*persistent->handle()); 618 auto o = persistent->handle();
617 auto isolate = v8::Isolate::GetCurrent(); 619 auto isolate = v8::Isolate::GetCurrent();
618 620
619 Handle<Value> args = compatibility_new<Number>(isolate, pos); 621 Handle<Value> args = compatibility_new<Number>(isolate, pos);
620 622
621 auto ret = closure->Call(Undefined(isolate), 1, &args); 623 auto ret = Function::Cast(*o)->Call(o->ToObject(), 1, &args);
622 auto bret = ret->IsBoolean() && ret->BooleanValue(); 624 auto bret = ret->IsBoolean() && ret->BooleanValue();
623 625
624 if (!bret) 626 if (!bret)
diff --git a/src/bindings/ecore_js/ecore_js_event.cc b/src/bindings/ecore_js/ecore_js_event.cc
index 72313e3..b050927 100644
--- a/src/bindings/ecore_js/ecore_js_event.cc
+++ b/src/bindings/ecore_js/ecore_js_event.cc
@@ -29,6 +29,7 @@ static v8::Local<v8::Object> wrap_event(Ecore_Event *event,
29 return compatibility_return(); 29 return compatibility_return();
30 30
31 ecore_event_del(extract_event(info.This())); 31 ecore_event_del(extract_event(info.This()));
32 return compatibility_return();
32 }; 33 };
33 34
34 ret->Set(compatibility_new<String>(isolate, "del"), 35 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -65,6 +66,7 @@ static v8::Local<v8::Object> wrap_event_handler(Ecore_Event_Handler *handler,
65 auto p = ecore_event_handler_del(extract_event_handler(info.This())); 66 auto p = ecore_event_handler_del(extract_event_handler(info.This()));
66 67
67 delete reinterpret_cast<compatibility_persistent<Value>*>(p); 68 delete reinterpret_cast<compatibility_persistent<Value>*>(p);
69 return compatibility_return();
68 }; 70 };
69 71
70 ret->Set(compatibility_new<String>(isolate, "del"), 72 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -100,6 +102,7 @@ static v8::Local<v8::Object> wrap_event_filter(Ecore_Event_Filter *filter,
100 102
101 auto p = ecore_event_filter_del(extract_event_filter(info.This())); 103 auto p = ecore_event_filter_del(extract_event_filter(info.This()));
102 delete[] reinterpret_cast<compatibility_persistent<Value>*>(p); 104 delete[] reinterpret_cast<compatibility_persistent<Value>*>(p);
105 return compatibility_return();
103 }; 106 };
104 107
105 ret->Set(compatibility_new<String>(isolate, "del"), 108 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -292,12 +295,12 @@ void register_event_handler_add(v8::Isolate *isolate,
292 auto cb = [](void *d, int type, void */*event*/) -> Eina_Bool { 295 auto cb = [](void *d, int type, void */*event*/) -> Eina_Bool {
293 auto persistent 296 auto persistent
294 = reinterpret_cast<compatibility_persistent<Value>*>(d); 297 = reinterpret_cast<compatibility_persistent<Value>*>(d);
295 auto closure = Function::Cast(*persistent->handle()); 298 auto o = persistent->handle();
296 299
297 auto isolate = v8::Isolate::GetCurrent(); 300 auto isolate = v8::Isolate::GetCurrent();
298 Handle<Value> args = compatibility_new<Integer>(isolate, type); 301 Handle<Value> args = compatibility_new<Integer>(isolate, type);
299 302
300 auto ret = closure->Call(Undefined(isolate), 1, &args); 303 auto ret = Function::Cast(*o)->Call(o->ToObject(), 1, &args);
301 auto bret = ret->IsBoolean() && ret->BooleanValue(); 304 auto bret = ret->IsBoolean() && ret->BooleanValue();
302 305
303 return bret ? EINA_TRUE : EINA_FALSE; 306 return bret ? EINA_TRUE : EINA_FALSE;
@@ -339,9 +342,9 @@ void register_event_filter_add(v8::Isolate *isolate,
339 auto start_cb = [](void *data) -> void* { 342 auto start_cb = [](void *data) -> void* {
340 auto p = reinterpret_cast<compatibility_persistent<Value>*>(data); 343 auto p = reinterpret_cast<compatibility_persistent<Value>*>(data);
341 auto isolate = v8::Isolate::GetCurrent(); 344 auto isolate = v8::Isolate::GetCurrent();
342 auto closure = Function::Cast(*p->handle()); 345 auto o = p->handle();
343 346
344 auto ret = closure->Call(Undefined(isolate), 0, NULL); 347 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
345 return new compatibility_persistent<Value>{isolate, ret}; 348 return new compatibility_persistent<Value>{isolate, ret};
346 }; 349 };
347 350
@@ -351,14 +354,14 @@ void register_event_filter_add(v8::Isolate *isolate,
351 354
352 auto p = reinterpret_cast<p_t*>(data) + 1; 355 auto p = reinterpret_cast<p_t*>(data) + 1;
353 auto isolate = v8::Isolate::GetCurrent(); 356 auto isolate = v8::Isolate::GetCurrent();
354 auto closure = Function::Cast(*p->handle()); 357 auto o = p->handle();
355 358
356 Handle<Value> args[2]{ 359 Handle<Value> args[2]{
357 reinterpret_cast<p_t*>(loop_data)->handle(), 360 reinterpret_cast<p_t*>(loop_data)->handle(),
358 compatibility_new<Integer>(isolate, type) 361 compatibility_new<Integer>(isolate, type)
359 }; 362 };
360 363
361 auto ret = closure->Call(Undefined(isolate), 2, args); 364 auto ret = Function::Cast(*o)->Call(o->ToObject(), 2, args);
362 auto bret = ret->IsBoolean() && ret->BooleanValue(); 365 auto bret = ret->IsBoolean() && ret->BooleanValue();
363 366
364 return bret ? EINA_TRUE : EINA_FALSE; 367 return bret ? EINA_TRUE : EINA_FALSE;
@@ -370,11 +373,11 @@ void register_event_filter_add(v8::Isolate *isolate,
370 auto loop_data = std::unique_ptr<p_t>(reinterpret_cast<p_t*> 373 auto loop_data = std::unique_ptr<p_t>(reinterpret_cast<p_t*>
371 (func_data)); 374 (func_data));
372 auto p = reinterpret_cast<p_t*>(user_data) + 2; 375 auto p = reinterpret_cast<p_t*>(user_data) + 2;
373 auto closure = Function::Cast(*p->handle()); 376 auto o = p->handle();
374 377
375 Handle<Value> args = p->handle(); 378 Handle<Value> args = p->handle();
376 379
377 closure->Call(Undefined(v8::Isolate::GetCurrent()), 1, &args); 380 Function::Cast(*o)->Call(o->ToObject(), 1, &args);
378 }; 381 };
379 382
380 auto ret = ecore_event_filter_add(start_cb, filter_cb, end_cb, p); 383 auto ret = ecore_event_filter_add(start_cb, filter_cb, end_cb, p);
@@ -530,7 +533,7 @@ void register_event_signal_user_handler_add(v8::Isolate *isolate,
530 auto cb = [](void *d, int type, void *event) -> Eina_Bool { 533 auto cb = [](void *d, int type, void *event) -> Eina_Bool {
531 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d); 534 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d);
532 auto isolate = v8::Isolate::GetCurrent(); 535 auto isolate = v8::Isolate::GetCurrent();
533 auto closure = Function::Cast(*p->handle()); 536 auto o = p->handle();
534 537
535 auto wrapped_event = compatibility_new<Object>(isolate); 538 auto wrapped_event = compatibility_new<Object>(isolate);
536 539
@@ -546,7 +549,7 @@ void register_event_signal_user_handler_add(v8::Isolate *isolate,
546 wrapped_event 549 wrapped_event
547 }; 550 };
548 551
549 auto ret = closure->Call(Undefined(isolate), 2, args); 552 auto ret = Function::Cast(*o)->Call(o->ToObject(), 2, args);
550 auto bret = ret->IsBoolean() && ret->BooleanValue(); 553 auto bret = ret->IsBoolean() && ret->BooleanValue();
551 554
552 return bret ? EINA_TRUE : EINA_FALSE; 555 return bret ? EINA_TRUE : EINA_FALSE;
@@ -587,7 +590,7 @@ void register_event_signal_exit_handler_add(v8::Isolate *isolate,
587 auto cb = [](void *d, int type, void *ev) -> Eina_Bool { 590 auto cb = [](void *d, int type, void *ev) -> Eina_Bool {
588 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d); 591 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d);
589 auto isolate = v8::Isolate::GetCurrent(); 592 auto isolate = v8::Isolate::GetCurrent();
590 auto closure = Function::Cast(*p->handle()); 593 auto o = p->handle();
591 594
592 auto wrapped_event = compatibility_new<Object>(isolate); 595 auto wrapped_event = compatibility_new<Object>(isolate);
593 596
@@ -614,7 +617,7 @@ void register_event_signal_exit_handler_add(v8::Isolate *isolate,
614 wrapped_event 617 wrapped_event
615 }; 618 };
616 619
617 auto ret = closure->Call(Undefined(isolate), 2, args); 620 auto ret = Function::Cast(*o)->Call(o->ToObject(), 2, args);
618 auto bret = ret->IsBoolean() && ret->BooleanValue(); 621 auto bret = ret->IsBoolean() && ret->BooleanValue();
619 622
620 return bret ? EINA_TRUE : EINA_FALSE; 623 return bret ? EINA_TRUE : EINA_FALSE;
@@ -654,7 +657,7 @@ void register_event_signal_realtime_handler_add(v8::Isolate *isolate,
654 auto cb = [](void *d, int type, void *ev) -> Eina_Bool { 657 auto cb = [](void *d, int type, void *ev) -> Eina_Bool {
655 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d); 658 auto p = reinterpret_cast<compatibility_persistent<Value>*>(d);
656 auto isolate = v8::Isolate::GetCurrent(); 659 auto isolate = v8::Isolate::GetCurrent();
657 auto closure = Function::Cast(*p->handle()); 660 auto o = p->handle();
658 661
659 auto wrapped_event = compatibility_new<Object>(isolate); 662 auto wrapped_event = compatibility_new<Object>(isolate);
660 663
@@ -670,7 +673,7 @@ void register_event_signal_realtime_handler_add(v8::Isolate *isolate,
670 wrapped_event 673 wrapped_event
671 }; 674 };
672 675
673 auto ret = closure->Call(Undefined(isolate), 2, args); 676 auto ret = Function::Cast(*o)->Call(o->ToObject(), 2, args);
674 auto bret = ret->IsBoolean() && ret->BooleanValue(); 677 auto bret = ret->IsBoolean() && ret->BooleanValue();
675 678
676 return bret ? EINA_TRUE : EINA_FALSE; 679 return bret ? EINA_TRUE : EINA_FALSE;
diff --git a/src/bindings/ecore_js/ecore_js_idle.cc b/src/bindings/ecore_js/ecore_js_idle.cc
index 579297e..bf20506 100644
--- a/src/bindings/ecore_js/ecore_js_idle.cc
+++ b/src/bindings/ecore_js/ecore_js_idle.cc
@@ -31,6 +31,7 @@ v8::Local<v8::Object> wrap_idler(Ecore_Idler *idler, v8::Isolate *isolate)
31 return compatibility_return(); 31 return compatibility_return();
32 32
33 ecore_idler_del(extract_idler(info.This())); 33 ecore_idler_del(extract_idler(info.This()));
34 return compatibility_return();
34 }; 35 };
35 36
36 ret->Set(compatibility_new<String>(isolate, "del"), 37 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -66,6 +67,7 @@ static v8::Local<v8::Object> wrap_idle_enterer(Ecore_Idle_Enterer *idle_enterer,
66 return compatibility_return(); 67 return compatibility_return();
67 68
68 ecore_idle_enterer_del(extract_idle_enterer(info.This())); 69 ecore_idle_enterer_del(extract_idle_enterer(info.This()));
70 return compatibility_return();
69 }; 71 };
70 72
71 ret->Set(compatibility_new<String>(isolate, "del"), 73 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -102,6 +104,7 @@ static v8::Local<v8::Object> wrap_idle_exiter(Ecore_Idle_Exiter *idle_exiter,
102 return compatibility_return(); 104 return compatibility_return();
103 105
104 ecore_idle_exiter_del(extract_idle_exiter(info.This())); 106 ecore_idle_exiter_del(extract_idle_exiter(info.This()));
107 return compatibility_return();
105 }; 108 };
106 109
107 ret->Set(compatibility_new<String>(isolate, "del"), 110 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -132,10 +135,9 @@ void register_idler_add(v8::Isolate *isolate, v8::Handle<v8::Object> global,
132 auto ret = ecore_idler_add([](void *data) -> Eina_Bool { 135 auto ret = ecore_idler_add([](void *data) -> Eina_Bool {
133 compatibility_persistent<Value> *persistent 136 compatibility_persistent<Value> *persistent
134 = reinterpret_cast<compatibility_persistent<Value>*>(data); 137 = reinterpret_cast<compatibility_persistent<Value>*>(data);
135 auto closure = Function::Cast(*persistent->handle()); 138 auto o = persistent->handle();
136 139
137 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 140 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
138 NULL);
139 auto bret = ret->IsBoolean() && ret->BooleanValue(); 141 auto bret = ret->IsBoolean() && ret->BooleanValue();
140 142
141 if (!bret) 143 if (!bret)
@@ -172,10 +174,9 @@ void register_idle_enterer_add(v8::Isolate *isolate,
172 auto ret = ecore_idle_enterer_add([](void *data) -> Eina_Bool { 174 auto ret = ecore_idle_enterer_add([](void *data) -> Eina_Bool {
173 compatibility_persistent<Value> *persistent 175 compatibility_persistent<Value> *persistent
174 = reinterpret_cast<compatibility_persistent<Value>*>(data); 176 = reinterpret_cast<compatibility_persistent<Value>*>(data);
175 auto closure = Function::Cast(*persistent->handle()); 177 auto o = persistent->handle();
176 178
177 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 179 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
178 NULL);
179 auto bret = ret->IsBoolean() && ret->BooleanValue(); 180 auto bret = ret->IsBoolean() && ret->BooleanValue();
180 181
181 if (!bret) 182 if (!bret)
@@ -213,10 +214,9 @@ void register_idle_enterer_before_add(v8::Isolate *isolate,
213 auto ret = ecore_idle_enterer_before_add([](void *data) -> Eina_Bool { 214 auto ret = ecore_idle_enterer_before_add([](void *data) -> Eina_Bool {
214 compatibility_persistent<Value> *persistent 215 compatibility_persistent<Value> *persistent
215 = reinterpret_cast<compatibility_persistent<Value>*>(data); 216 = reinterpret_cast<compatibility_persistent<Value>*>(data);
216 auto closure = Function::Cast(*persistent->handle()); 217 auto o = persistent->handle();
217 218
218 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 219 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
219 NULL);
220 auto bret = ret->IsBoolean() && ret->BooleanValue(); 220 auto bret = ret->IsBoolean() && ret->BooleanValue();
221 221
222 if (!bret) 222 if (!bret)
@@ -254,10 +254,9 @@ void register_idle_exiter_add(v8::Isolate *isolate,
254 auto ret = ecore_idle_exiter_add([](void *data) -> Eina_Bool { 254 auto ret = ecore_idle_exiter_add([](void *data) -> Eina_Bool {
255 compatibility_persistent<Value> *persistent 255 compatibility_persistent<Value> *persistent
256 = reinterpret_cast<compatibility_persistent<Value>*>(data); 256 = reinterpret_cast<compatibility_persistent<Value>*>(data);
257 auto closure = Function::Cast(*persistent->handle()); 257 auto o = persistent->handle();
258 258
259 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 259 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
260 NULL);
261 auto bret = ret->IsBoolean() && ret->BooleanValue(); 260 auto bret = ret->IsBoolean() && ret->BooleanValue();
262 261
263 if (!bret) 262 if (!bret)
diff --git a/src/bindings/ecore_js/ecore_js_job.cc b/src/bindings/ecore_js/ecore_js_job.cc
index 349fa3d..fd1e7b4 100644
--- a/src/bindings/ecore_js/ecore_js_job.cc
+++ b/src/bindings/ecore_js/ecore_js_job.cc
@@ -30,6 +30,7 @@ static v8::Local<v8::Object> wrap_job(Ecore_Job *job, v8::Isolate *isolate)
30 return compatibility_return(); 30 return compatibility_return();
31 31
32 ecore_job_del(extract_job(info.This())); 32 ecore_job_del(extract_job(info.This()));
33 return compatibility_return();
33 }; 34 };
34 35
35 ret->Set(compatibility_new<String>(isolate, "del"), 36 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -60,9 +61,9 @@ void register_job_add(v8::Isolate *isolate, v8::Handle<v8::Object> global,
60 auto ret = ecore_job_add([](void *data) { 61 auto ret = ecore_job_add([](void *data) {
61 compatibility_persistent<Value> *persistent 62 compatibility_persistent<Value> *persistent
62 = reinterpret_cast<compatibility_persistent<Value>*>(data); 63 = reinterpret_cast<compatibility_persistent<Value>*>(data);
63 auto closure = Function::Cast(*persistent->handle()); 64 auto o = persistent->handle();
64 65
65 closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, NULL); 66 Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
66 67
67 delete persistent; 68 delete persistent;
68 }, f); 69 }, f);
diff --git a/src/bindings/ecore_js/ecore_js_mainloop.cc b/src/bindings/ecore_js/ecore_js_mainloop.cc
index 3319efd..5fdf7c9 100644
--- a/src/bindings/ecore_js/ecore_js_mainloop.cc
+++ b/src/bindings/ecore_js/ecore_js_mainloop.cc
@@ -195,9 +195,8 @@ void register_mainloop_thread_safe_call_async(v8::Isolate *isolate,
195 ecore_main_loop_thread_safe_call_async([](void *data) { 195 ecore_main_loop_thread_safe_call_async([](void *data) {
196 compatibility_persistent<Value> *persistent 196 compatibility_persistent<Value> *persistent
197 = reinterpret_cast<compatibility_persistent<Value>*>(data); 197 = reinterpret_cast<compatibility_persistent<Value>*>(data);
198 auto closure = Function::Cast(*persistent->handle()); 198 auto o = persistent->handle();
199 199 Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
200 closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, NULL);
201 200
202 delete persistent; 201 delete persistent;
203 }, f); 202 }, f);
@@ -230,8 +229,8 @@ void register_mainloop_thread_safe_call_sync(v8::Isolate *isolate,
230 compatibility_persistent<Value> *persistent 229 compatibility_persistent<Value> *persistent
231 = reinterpret_cast<compatibility_persistent<Value>*>(data); 230 = reinterpret_cast<compatibility_persistent<Value>*>(data);
232 auto isolate = v8::Isolate::GetCurrent(); 231 auto isolate = v8::Isolate::GetCurrent();
233 auto closure = Function::Cast(*persistent->handle()); 232 auto o = persistent->handle();
234 auto res = closure->Call(Undefined(isolate), 0, NULL); 233 auto res = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
235 void *ret = new compatibility_persistent<Value>(isolate, res); 234 void *ret = new compatibility_persistent<Value>(isolate, res);
236 235
237 delete persistent; 236 delete persistent;
diff --git a/src/bindings/ecore_js/ecore_js_poller.cc b/src/bindings/ecore_js/ecore_js_poller.cc
index 092b994..e2dcab2 100644
--- a/src/bindings/ecore_js/ecore_js_poller.cc
+++ b/src/bindings/ecore_js/ecore_js_poller.cc
@@ -31,6 +31,7 @@ static v8::Local<v8::Object> wrap_poller(Ecore_Poller *poller,
31 return compatibility_return(); 31 return compatibility_return();
32 32
33 ecore_poller_del(extract_poller(info.This())); 33 ecore_poller_del(extract_poller(info.This()));
34 return compatibility_return();
34 }; 35 };
35 36
36 ret->Set(compatibility_new<String>(isolate, "del"), 37 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -74,6 +75,7 @@ void register_poller_poll_interval_set(v8::Isolate *isolate,
74 } 75 }
75 76
76 ecore_poller_poll_interval_set(type, args[1]->NumberValue()); 77 ecore_poller_poll_interval_set(type, args[1]->NumberValue());
78 return compatibility_return();
77 }; 79 };
78 80
79 global->Set(name, 81 global->Set(name,
@@ -146,9 +148,9 @@ void register_poller_add(v8::Isolate *isolate, v8::Handle<v8::Object> global,
146 auto cb = [](void *data) -> Eina_Bool { 148 auto cb = [](void *data) -> Eina_Bool {
147 auto persistent 149 auto persistent
148 = reinterpret_cast<compatibility_persistent<Value>*>(data); 150 = reinterpret_cast<compatibility_persistent<Value>*>(data);
149 auto closure = Function::Cast(*persistent->handle()); 151 auto o = persistent->handle();
150 152
151 auto ret = closure->Call(Undefined(Isolate::GetCurrent()), 0, NULL); 153 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
152 auto bret = ret->IsBoolean() && ret->BooleanValue(); 154 auto bret = ret->IsBoolean() && ret->BooleanValue();
153 155
154 if (!bret) 156 if (!bret)
diff --git a/src/bindings/ecore_js/ecore_js_timer.cc b/src/bindings/ecore_js/ecore_js_timer.cc
index e57bdd0..6631462 100644
--- a/src/bindings/ecore_js/ecore_js_timer.cc
+++ b/src/bindings/ecore_js/ecore_js_timer.cc
@@ -33,6 +33,7 @@ static v8::Local<v8::Object> wrap_timer(Ecore_Timer *timer,
33 return compatibility_return(); 33 return compatibility_return();
34 34
35 ecore_timer_del(extract_timer(info.This())); 35 ecore_timer_del(extract_timer(info.This()));
36 return compatibility_return();
36 }; 37 };
37 38
38 auto freeze = [](compatibility_callback_info_type info) 39 auto freeze = [](compatibility_callback_info_type info)
@@ -41,6 +42,7 @@ static v8::Local<v8::Object> wrap_timer(Ecore_Timer *timer,
41 return compatibility_return(); 42 return compatibility_return();
42 43
43 ecore_timer_freeze(extract_timer(info.This())); 44 ecore_timer_freeze(extract_timer(info.This()));
45 return compatibility_return();
44 }; 46 };
45 47
46 auto freeze_get = [](compatibility_callback_info_type info) 48 auto freeze_get = [](compatibility_callback_info_type info)
@@ -60,6 +62,7 @@ static v8::Local<v8::Object> wrap_timer(Ecore_Timer *timer,
60 return compatibility_return(); 62 return compatibility_return();
61 63
62 ecore_timer_thaw(extract_timer(info.This())); 64 ecore_timer_thaw(extract_timer(info.This()));
65 return compatibility_return();
63 }; 66 };
64 67
65 ret->Set(compatibility_new<String>(isolate, "del"), 68 ret->Set(compatibility_new<String>(isolate, "del"),
@@ -173,10 +176,9 @@ void register_timer_add(v8::Isolate *isolate, v8::Handle<v8::Object> global,
173 auto cb = [](void *data) -> Eina_Bool { 176 auto cb = [](void *data) -> Eina_Bool {
174 auto persistent 177 auto persistent
175 = reinterpret_cast<compatibility_persistent<Value>*>(data); 178 = reinterpret_cast<compatibility_persistent<Value>*>(data);
176 auto closure = Function::Cast(*persistent->handle()); 179 auto o = persistent->handle();
177 180
178 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 181 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
179 NULL);
180 auto bret = ret->IsBoolean() && ret->BooleanValue(); 182 auto bret = ret->IsBoolean() && ret->BooleanValue();
181 183
182 if (!bret) 184 if (!bret)
@@ -217,10 +219,9 @@ void register_timer_loop_add(v8::Isolate *isolate,
217 auto cb = [](void *d) -> Eina_Bool { 219 auto cb = [](void *d) -> Eina_Bool {
218 auto persistent 220 auto persistent
219 = reinterpret_cast<compatibility_persistent<Value>*>(d); 221 = reinterpret_cast<compatibility_persistent<Value>*>(d);
220 auto closure = Function::Cast(*persistent->handle()); 222 auto o = persistent->handle();
221 223
222 auto ret = closure->Call(Undefined(v8::Isolate::GetCurrent()), 0, 224 auto ret = Function::Cast(*o)->Call(o->ToObject(), 0, NULL);
223 NULL);
224 auto bret = ret->IsBoolean() && ret->BooleanValue(); 225 auto bret = ret->IsBoolean() && ret->BooleanValue();
225 226
226 if (!bret) 227 if (!bret)
diff --git a/src/bindings/eina_js/eina_js_compatibility.hh b/src/bindings/eina_js/eina_js_compatibility.hh
index 72d054d..75ada9d 100644
--- a/src/bindings/eina_js/eina_js_compatibility.hh
+++ b/src/bindings/eina_js/eina_js_compatibility.hh
@@ -477,7 +477,23 @@ inline v8::Local<v8::Object> compatibility_global()
477{ 477{
478 return _v8_get_current_context<>::GetCurrent()->Global(); 478 return _v8_get_current_context<>::GetCurrent()->Global();
479} 479}
480 480
481template<class T = v8::StackTrace>
482typename std::enable_if<!v8_uses_isolate, v8::Local<T>>::type
483compatibility_current_stack_trace(v8::Isolate*, int frame_limit,
484 v8::StackTrace::StackTraceOptions options)
485{
486 return T::CurrentStackTrace(frame_limit, options);
487}
488
489template<class T = v8::StackTrace>
490typename std::enable_if<v8_uses_isolate, v8::Local<T>>::type
491compatibility_current_stack_trace(v8::Isolate *isolate, int frame_limit,
492 v8::StackTrace::StackTraceOptions options)
493{
494 return T::CurrentStackTrace(isolate, frame_limit, options);
495}
496
481} } } 497} } }
482 498
483#endif 499#endif
diff --git a/src/bindings/eina_js/eina_js_log.cc b/src/bindings/eina_js/eina_js_log.cc
index 00fbcd3..6fd6356 100644
--- a/src/bindings/eina_js/eina_js_log.cc
+++ b/src/bindings/eina_js/eina_js_log.cc
@@ -42,8 +42,7 @@ static void js_eina_log_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level,
42 constexpr unsigned argc = 7; 42 constexpr unsigned argc = 7;
43 43
44 v8::Handle<v8::Value> argv[argc] = { 44 v8::Handle<v8::Value> argv[argc] = {
45 compatibility_new<String>(isolate, d->name, String::kNormalString, 45 compatibility_new<String>(isolate, d->name),
46 d->namelen),
47 compatibility_new<String>(isolate, d->color), 46 compatibility_new<String>(isolate, d->color),
48 compatibility_new<Integer>(isolate, static_cast<int>(level)), 47 compatibility_new<Integer>(isolate, static_cast<int>(level)),
49 compatibility_new<String>(isolate, file), 48 compatibility_new<String>(isolate, file),
@@ -53,7 +52,7 @@ static void js_eina_log_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level,
53 }; 52 };
54 53
55 auto o = js_eina_log_print_cb_data.handle(); 54 auto o = js_eina_log_print_cb_data.handle();
56 v8::Function::Cast(*o)->Call(v8::Undefined(isolate), argc, argv); 55 v8::Function::Cast(*o)->Call(o->ToObject(), argc, argv);
57} 56}
58 57
59static bool valid_level_conversion(int src, Eina_Log_Level &dst) 58static bool valid_level_conversion(int src, Eina_Log_Level &dst)
@@ -138,15 +137,15 @@ void register_log_print(v8::Isolate *isolate, v8::Handle<v8::Object> global,
138 if (!valid_level_conversion(args[1]->NumberValue(), level)) 137 if (!valid_level_conversion(args[1]->NumberValue(), level))
139 return compatibility_return(); 138 return compatibility_return();
140 139
141 auto frame = StackTrace::CurrentStackTrace(args.GetIsolate(), 1, 140 auto frame = compatibility_current_stack_trace<>(args.GetIsolate(), 1,
142 StackTrace::kDetailed) 141 StackTrace::kDetailed)->GetFrame(0);
143 ->GetFrame(0);
144 142
145 eina_log_print(args[0]->NumberValue(), level, 143 eina_log_print(args[0]->NumberValue(), level,
146 *String::Utf8Value(frame->GetScriptNameOrSourceURL()), 144 *String::Utf8Value(frame->GetScriptNameOrSourceURL()),
147 *String::Utf8Value(frame->GetFunctionName()), 145 *String::Utf8Value(frame->GetFunctionName()),
148 frame->GetLineNumber(), "%s", 146 frame->GetLineNumber(), "%s",
149 *String::Utf8Value(args[2])); 147 *String::Utf8Value(args[2]));
148 return compatibility_return();
150 }; 149 };
151 150
152 global->Set(name, 151 global->Set(name,
@@ -193,6 +192,7 @@ void register_log_domain_unregister(v8::Isolate *isolate,
193 return compatibility_return(); 192 return compatibility_return();
194 193
195 eina_log_domain_unregister(args[0]->NumberValue()); 194 eina_log_domain_unregister(args[0]->NumberValue());
195 return compatibility_return();
196 }; 196 };
197 197
198 global->Set(name, 198 global->Set(name,
@@ -237,6 +237,7 @@ void register_log_domain_registered_level_set(v8::Isolate *isolate,
237 237
238 eina_log_domain_registered_level_set(args[0]->NumberValue(), 238 eina_log_domain_registered_level_set(args[0]->NumberValue(),
239 args[1]->NumberValue()); 239 args[1]->NumberValue());
240 return compatibility_return();
240 }; 241 };
241 242
242 global->Set(name, 243 global->Set(name,
@@ -259,6 +260,7 @@ void register_log_print_cb_set(v8::Isolate *isolate,
259 js_eina_log_print_cb_data 260 js_eina_log_print_cb_data
260 = compatibility_persistent<Value>(args.GetIsolate(), args[0]); 261 = compatibility_persistent<Value>(args.GetIsolate(), args[0]);
261 eina_log_print_cb_set(js_eina_log_print_cb, NULL); 262 eina_log_print_cb_set(js_eina_log_print_cb, NULL);
263 return compatibility_return();
262 }; 264 };
263 265
264 global->Set(name, 266 global->Set(name,
@@ -278,6 +280,7 @@ void register_log_level_set(v8::Isolate *isolate, v8::Handle<v8::Object> global,
278 return compatibility_return(); 280 return compatibility_return();
279 281
280 eina_log_level_set(args[0]->NumberValue()); 282 eina_log_level_set(args[0]->NumberValue());
283 return compatibility_return();
281 }; 284 };
282 285
283 global->Set(name, 286 global->Set(name,
@@ -343,6 +346,7 @@ void register_log_color_disable_set(v8::Isolate *isolate,
343 return compatibility_return(); 346 return compatibility_return();
344 347
345 eina_log_color_disable_set(args[0]->BooleanValue()); 348 eina_log_color_disable_set(args[0]->BooleanValue());
349 return compatibility_return();
346 }; 350 };
347 351
348 global->Set(name, 352 global->Set(name,
@@ -386,6 +390,7 @@ void register_log_file_disable_set(v8::Isolate *isolate,
386 return compatibility_return(); 390 return compatibility_return();
387 391
388 eina_log_file_disable_set(args[0]->BooleanValue()); 392 eina_log_file_disable_set(args[0]->BooleanValue());
393 return compatibility_return();
389 }; 394 };
390 395
391 global->Set(name, 396 global->Set(name,
@@ -429,6 +434,7 @@ void register_log_function_disable_set(v8::Isolate *isolate,
429 return compatibility_return(); 434 return compatibility_return();
430 435
431 eina_log_function_disable_set(args[0]->BooleanValue()); 436 eina_log_function_disable_set(args[0]->BooleanValue());
437 return compatibility_return();
432 }; 438 };
433 439
434 global->Set(name, 440 global->Set(name,
@@ -472,6 +478,7 @@ void register_log_abort_on_critical_set(v8::Isolate *isolate,
472 return compatibility_return(); 478 return compatibility_return();
473 479
474 eina_log_abort_on_critical_set(args[0]->BooleanValue()); 480 eina_log_abort_on_critical_set(args[0]->BooleanValue());
481 return compatibility_return();
475 }; 482 };
476 483
477 global->Set(name, 484 global->Set(name,
@@ -515,6 +522,7 @@ void register_log_abort_on_critical_level_set(v8::Isolate *isolate,
515 return compatibility_return(); 522 return compatibility_return();
516 523
517 eina_log_abort_on_critical_level_set(args[0]->NumberValue()); 524 eina_log_abort_on_critical_level_set(args[0]->NumberValue());
525 return compatibility_return();
518 }; 526 };
519 527
520 global->Set(name, 528 global->Set(name,
@@ -560,6 +568,7 @@ void register_log_domain_level_set(v8::Isolate *isolate,
560 568
561 eina_log_domain_level_set(*String::Utf8Value(args[0]), 569 eina_log_domain_level_set(*String::Utf8Value(args[0]),
562 args[1]->NumberValue()); 570 args[1]->NumberValue());
571 return compatibility_return();
563 }; 572 };
564 573
565 global->Set(name, 574 global->Set(name,
@@ -626,6 +635,7 @@ void register_log_timing(v8::Isolate *isolate, v8::Handle<v8::Object> global,
626 eina_log_timing(args[0]->NumberValue(), 635 eina_log_timing(args[0]->NumberValue(),
627 static_cast<Eina_Log_State>(args[1]->NumberValue()), 636 static_cast<Eina_Log_State>(args[1]->NumberValue()),
628 *String::Utf8Value(args[2])); 637 *String::Utf8Value(args[2]));
638 return compatibility_return();
629 }; 639 };
630 640
631 global->Set(name, 641 global->Set(name,