@@ -356,7 +356,7 @@ void HUI_WebView_call_js_async (HUI_WebView object, const char* code, voi
356356 static_cast <HUI::WebView*>(object)->call_js (code, cpp_callback);
357357}
358358const char * HUI_WebView_call_native (HUI_WebView object, void (*handler)(char **,int ,void *), void* data, const char* process_args){
359- auto cpp_handler = [data, handler](std::vector<std::string> args)->void {
359+ auto cpp_handler = [handler,&data ](std::vector<std::string> args)->void {
360360 // from <https://stackoverflow.com/a/26032303/21213243>
361361 std::vector<char *> c_args;
362362 c_args.reserve (args.size ());
@@ -545,28 +545,28 @@ tested with: <https://jsbench.me>
545545---
546546
547547document.querySelectorAll("body div:nth-of-type(3)").forEach(function(e){e.innerText = "e";})
548- [261 tis. ops/s ± 6.61% ~ 15.62 % slower]
548+ [261 tis. ops/s ± 6.61% ~ 15.62 % slower]
549549
550550(function(e){e.innerText = "e";})(document.querySelectorAll("body div")[2])
551- [299 tis. ops/s ± 1.55% ~ 3.39 % slower]
551+ [299 tis. ops/s ± 1.55% ~ 3.39 % slower]
552552
553553document.querySelectorAll("body div")[2].innerText = "e";
554- [303 tis. ops/s ± 2.73% ~ Fastest]
554+ [303 tis. ops/s ± 2.73% ~ Fastest]
555555
556556let q = document.querySelectorAll("body div:nth-of-type(3)");
557557if (q.length == 1) {q[0].innerText = "e";}
558558else {q.forEach(function(e){e.innerText = "e";})}
559- [309 tis. ops/s ± 1.07% ~ Fastest]
559+ [309 tis. ops/s ± 1.07% ~ Fastest]
560560
561561---
562562
563563document.querySelectorAll("body div").forEach(function(e){e.innerText = "e";})
564- [308 tis. ops/s ± 2.95% ~ 18.12 % slower]
564+ [308 tis. ops/s ± 2.95% ~ 18.12 % slower]
565565
566566let q = document.querySelectorAll("body div");
567567if (q.length == 1) {q[0].innerText = "e";}
568568else {q.forEach(function(e){e.innerText = "e";})}
569- [377 tis. ops/s ± 2.9% ~ Fastest]
569+ [377 tis. ops/s ± 2.9% ~ Fastest]
570570
571571
572572
@@ -596,4 +596,4 @@ void WebView::call_js (std::string code, std::function<void(std::string)> return
596596#endif // _hui_webview_use_common_code
597597
598598
599- #endif // _HUI_hh_
599+ #endif // _HUI_hh_
0 commit comments