@@ -467,10 +467,6 @@ void StatementSync::All(const FunctionCallbackInfo<Value>& args) {
467
467
Array::New (env->isolate (), rows.data (), rows.size ()));
468
468
}
469
469
470
- void IteratorFunc (const v8::FunctionCallbackInfo<v8::Value>& info) {
471
- info.GetReturnValue ().Set (info.Holder ());
472
- }
473
-
474
470
struct IterateCaptureContext {
475
471
int num_cols;
476
472
StatementSync* stmt;
@@ -543,13 +539,11 @@ void StatementSync::Iterate(const FunctionCallbackInfo<Value>& args) {
543
539
v8::External::New (isolate, captureContext)
544
540
);
545
541
546
- v8::Local<v8::FunctionTemplate> iteratorFuncTemplate = v8::FunctionTemplate::New (isolate, IteratorFunc);
547
542
iterableIteratorTemplate->Set (String::NewFromUtf8Literal (isolate, " next" ), nextFuncTemplate);
548
- iterableIteratorTemplate->Set (v8::Symbol::GetIterator (isolate), iteratorFuncTemplate);
549
543
550
- v8::Local<v8::Value> iteratorPrototype = context-> Global ()-> Get ( context, String::NewFromUtf8Literal (isolate, " Iterator.prototype " ) ).ToLocalChecked ();
551
- v8::Local<v8::Object> iterableIterator = iterableIteratorTemplate-> NewInstance ( context).ToLocalChecked ();
552
- iterableIterator->SetPrototype (context, iteratorPrototype). ToChecked ();
544
+ auto iterableIterator = iterableIteratorTemplate-> NewInstance ( context).ToLocalChecked ();
545
+ auto JSIteratorPrototype = context-> Global ()-> Get ( context, String::NewFromUtf8Literal (isolate, " Iterator.prototype " ) ).ToLocalChecked ();
546
+ iterableIterator->SetPrototype (context, JSIteratorPrototype). Check ();
553
547
554
548
args.GetReturnValue ().Set (iterableIterator);
555
549
}
0 commit comments