diff --git a/src/env_properties.h b/src/env_properties.h index 4265b87c516..429c51a1f94 100644 --- a/src/env_properties.h +++ b/src/env_properties.h @@ -90,6 +90,7 @@ V(cached_data_string, "cachedData") \ V(cache_key_string, "cacheKey") \ V(change_string, "change") \ + V(changes_string, "changes") \ V(channel_string, "channel") \ V(chunks_sent_since_last_write_string, "chunksSentSinceLastWrite") \ V(clone_unsupported_type_str, "Cannot clone object of unsupported type.") \ @@ -215,6 +216,7 @@ V(jwk_y_string, "y") \ V(kill_signal_string, "killSignal") \ V(kind_string, "kind") \ + V(last_insert_rowid_string, "lastInsertRowid") \ V(length_string, "length") \ V(library_string, "library") \ V(line_number_string, "lineNumber") \ diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index 3e08ed796e9..a791b724124 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -694,10 +694,6 @@ void StatementSync::Run(const FunctionCallbackInfo& args) { } Local result = Object::New(env->isolate()); - Local last_insert_rowid_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "lastInsertRowid"); - Local changes_string = - FIXED_ONE_BYTE_STRING(env->isolate(), "changes"); sqlite3_int64 last_insert_rowid = sqlite3_last_insert_rowid(stmt->db_->Connection()); sqlite3_int64 changes = sqlite3_changes64(stmt->db_->Connection()); @@ -713,9 +709,12 @@ void StatementSync::Run(const FunctionCallbackInfo& args) { } if (result - ->Set(env->context(), last_insert_rowid_string, last_insert_rowid_val) + ->Set(env->context(), + env->last_insert_rowid_string(), + last_insert_rowid_val) .IsNothing() || - result->Set(env->context(), changes_string, changes_val).IsNothing()) { + result->Set(env->context(), env->changes_string(), changes_val) + .IsNothing()) { return; }