GeezerVison is showing github.com — src: replace FIXED_ONE_BYTE_STRING with Environment-cached strings · nodejs/node@26b40ba
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/node_realm.cc +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -52,8 +52,7 @@ void Realm::CreateProperties() { | 52 | 52 | CHECK(primordials->IsObject()); | 53 | 53 | set_primordials(primordials.As<Object>()); | 54 | 54 |
| 55 | | - Local<String> prototype_string = | 56 | | - FIXED_ONE_BYTE_STRING(isolate(), "prototype"); | | 55 | + Local<String> prototype_string = env_->prototype_string(); | 57 | 56 |
| 58 | 57 | #define V(EnvPropertyName, PrimordialsPropertyName) \ | 59 | 58 | { \ | |
Collapse file Copy file name to clipboardExpand all lines: src/node_sqlite.cc +2-4Lines changed: 2 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1215,9 +1215,7 @@ void DatabaseSync::CustomFunction(const FunctionCallbackInfo<Value>& args) { | 1215 | 1215 | argc = -1; | 1216 | 1216 | } else { | 1217 | 1217 | 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)) { | 1221 | 1219 | return; | 1222 | 1220 | } | 1223 | 1221 | argc = js_len.As<Int32>()->Value(); | @@ -1448,7 +1446,7 @@ void DatabaseSync::CreateSession(const FunctionCallbackInfo<Value>& args) { | 1448 | 1446 |
| 1449 | 1447 | Local<Object> options = args[0].As<Object>(); | 1450 | 1448 |
| 1451 | | - Local<String> table_key = FIXED_ONE_BYTE_STRING(env->isolate(), "table"); | | 1449 | + Local<String> table_key = env->table_string(); | 1452 | 1450 | bool hasIt; | 1453 | 1451 | if (!options->HasOwnProperty(env->context(), table_key).To(&hasIt)) { | 1454 | 1452 | return; | |
Collapse file Copy file name to clipboardExpand all lines: src/node_webstorage.cc +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -741,11 +741,10 @@ static void Initialize(Local<Object> target, | 741 | 741 |
| 742 | 742 | Local<FunctionTemplate> length_getter = | 743 | 743 | 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); | 749 | 748 |
| 750 | 749 | SetProtoMethod(isolate, ctor_tmpl, "clear", Clear); | 751 | 750 | SetProtoMethodNoSideEffect(isolate, ctor_tmpl, "getItem", GetItem); | |
Collapse file Copy file name to clipboardExpand all lines: src/stream_wrap.cc +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -84,8 +84,7 @@ void LibuvStreamWrap::Initialize(Local<Object> target, | 84 | 84 | sw->InstanceTemplate()->Set(env->oncomplete_string(), v8::Null(isolate)); | 85 | 85 | sw->InstanceTemplate()->Set(FIXED_ONE_BYTE_STRING(isolate, "callback"), | 86 | 86 | 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)); | 89 | 88 |
| 90 | 89 | sw->Inherit(AsyncWrap::GetConstructorTemplate(env)); | 91 | 90 |
| |
|