Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 26b40ba

Browse filesBrowse files
iknoomaduh95
authored andcommitted
src: replace FIXED_ONE_BYTE_STRING with Environment-cached strings
PR-URL: #59891 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
1 parent ba00875 commit 26b40ba
Copy full SHA for 26b40ba

File tree

Expand file treeCollapse file tree

4 files changed

+8
-13
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+8
-13
lines changed
Open diff view settings
Collapse file

‎src/node_realm.cc‎

Copy file name to clipboardExpand all lines: src/node_realm.cc
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ void Realm::CreateProperties() {
5252
CHECK(primordials->IsObject());
5353
set_primordials(primordials.As<Object>());
5454

55-
Local<String> prototype_string =
56-
FIXED_ONE_BYTE_STRING(isolate(), "prototype");
55+
Local<String> prototype_string = env_->prototype_string();
5756

5857
#define V(EnvPropertyName, PrimordialsPropertyName) \
5958
{ \
Collapse file

‎src/node_sqlite.cc‎

Copy file name to clipboardExpand all lines: src/node_sqlite.cc
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,9 +1215,7 @@ void DatabaseSync::CustomFunction(const FunctionCallbackInfo<Value>& args) {
12151215
argc = -1;
12161216
} else {
12171217
Local<Value> js_len;
1218-
if (!fn->Get(env->context(),
1219-
FIXED_ONE_BYTE_STRING(env->isolate(), "length"))
1220-
.ToLocal(&js_len)) {
1218+
if (!fn->Get(env->context(), env->length_string()).ToLocal(&js_len)) {
12211219
return;
12221220
}
12231221
argc = js_len.As<Int32>()->Value();
@@ -1448,7 +1446,7 @@ void DatabaseSync::CreateSession(const FunctionCallbackInfo<Value>& args) {
14481446

14491447
Local<Object> options = args[0].As<Object>();
14501448

1451-
Local<String> table_key = FIXED_ONE_BYTE_STRING(env->isolate(), "table");
1449+
Local<String> table_key = env->table_string();
14521450
bool hasIt;
14531451
if (!options->HasOwnProperty(env->context(), table_key).To(&hasIt)) {
14541452
return;
Collapse file

‎src/node_webstorage.cc‎

Copy file name to clipboardExpand all lines: src/node_webstorage.cc
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,11 +741,10 @@ static void Initialize(Local<Object> target,
741741

742742
Local<FunctionTemplate> length_getter =
743743
FunctionTemplate::New(isolate, StorageLengthGetter);
744-
ctor_tmpl->PrototypeTemplate()->SetAccessorProperty(
745-
FIXED_ONE_BYTE_STRING(isolate, "length"),
746-
length_getter,
747-
Local<FunctionTemplate>(),
748-
DontDelete);
744+
ctor_tmpl->PrototypeTemplate()->SetAccessorProperty(env->length_string(),
745+
length_getter,
746+
Local<FunctionTemplate>(),
747+
DontDelete);
749748

750749
SetProtoMethod(isolate, ctor_tmpl, "clear", Clear);
751750
SetProtoMethodNoSideEffect(isolate, ctor_tmpl, "getItem", GetItem);
Collapse file

‎src/stream_wrap.cc‎

Copy file name to clipboardExpand all lines: src/stream_wrap.cc
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ void LibuvStreamWrap::Initialize(Local<Object> target,
8484
sw->InstanceTemplate()->Set(env->oncomplete_string(), v8::Null(isolate));
8585
sw->InstanceTemplate()->Set(FIXED_ONE_BYTE_STRING(isolate, "callback"),
8686
v8::Null(isolate));
87-
sw->InstanceTemplate()->Set(FIXED_ONE_BYTE_STRING(isolate, "handle"),
88-
v8::Null(isolate));
87+
sw->InstanceTemplate()->Set(env->handle_string(), v8::Null(isolate));
8988

9089
sw->Inherit(AsyncWrap::GetConstructorTemplate(env));
9190

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.