| 70 | } |
| 71 | |
| 72 | NODE_METHOD(StatementIterator::JS_new) { |
| 73 | UseAddon; |
| 74 | if (!addon->privileged_info) return ThrowTypeError(info.Env(), "Disabled constructor"); |
| 75 | assert(info.IsConstructCall()); |
| 76 | |
| 77 | { |
| 78 | const Napi::CallbackInfo& info = *addon->privileged_info; |
| 79 | STATEMENT_START_LOGIC(REQUIRE_STATEMENT_RETURNS_DATA, DOES_ADD_ITERATOR); |
| 80 | this->stmt = stmt; |
| 81 | this->handle = stmt->handle; |
| 82 | this->db_state = stmt->db->GetState(); |
| 83 | this->bound = bound; |
| 84 | this->safe_ints = stmt->safe_ints; |
| 85 | this->mode = stmt->mode; |
| 86 | this->alive = true; |
| 87 | this->logged = !db_state->has_logger; |
| 88 | assert(stmt != NULL); |
| 89 | assert(handle != NULL); |
| 90 | assert(stmt->bound == bound); |
| 91 | assert(stmt->alive == true); |
| 92 | assert(stmt->locked == false); |
| 93 | assert(db_state->iterators < USHRT_MAX); |
| 94 | stmt->locked = true; |
| 95 | db_state->iterators += 1; |
| 96 | } |
| 97 | |
| 98 | UseIsolate; |
| 99 | SetFrozen(env, info.This().As<Napi::Object>(), addon->cs.statement, addon->privileged_info->This()); |
| 100 | |
| 101 | return info.This(); |
| 102 | } |
| 103 | |
| 104 | NODE_METHOD(StatementIterator::JS_next) { |
| 105 | StatementIterator* iter = ::Unwrap<StatementIterator>(info.This()); |
nothing calls this directly
no test coverage detected