Skip to content

Commit eb2df37

Browse files
committed
🎨 Extra space for Utf8Strings to line up better
1 parent 59bad99 commit eb2df37

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

generate/templates/manual/clone/clone.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ NAN_METHOD(GitClone::Clone) {
3333
// start convert_from_v8 block
3434
const char *from_url = NULL;
3535

36-
Nan::Utf8String url(Nan::To<v8::String>(info[0]).ToLocalChecked());
36+
Nan::Utf8String url(Nan::To<v8::String>(info[0]).ToLocalChecked());
3737
// malloc with one extra byte so we can add the terminating null character
3838
// C-strings expect:
3939
from_url = (const char *)malloc(url.length() + 1);
@@ -50,7 +50,7 @@ NAN_METHOD(GitClone::Clone) {
5050
// start convert_from_v8 block
5151
const char *from_local_path = NULL;
5252

53-
Nan::Utf8String local_path(Nan::To<v8::String>(info[1]).ToLocalChecked());
53+
Nan::Utf8String local_path(Nan::To<v8::String>(info[1]).ToLocalChecked());
5454
// malloc with one extra byte so we can add the terminating null character
5555
// C-strings expect:
5656
from_local_path = (const char *)malloc(local_path.length() + 1);

generate/templates/manual/commit/extract_signature.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ NAN_METHOD(GitCommit::ExtractSignature)
3232

3333
// baton->commit_id
3434
if (info[1]->IsString()) {
35-
Nan::Utf8String oidString(Nan::To<v8::String>(info[1]).ToLocalChecked());
35+
Nan::Utf8String oidString(Nan::To<v8::String>(info[1]).ToLocalChecked());
3636
baton->commit_id = (git_oid *)malloc(sizeof(git_oid));
3737
if (git_oid_fromstr(baton->commit_id, (const char *)strdup(*oidString)) != GIT_OK) {
3838
free(baton->commit_id);
@@ -49,7 +49,7 @@ NAN_METHOD(GitCommit::ExtractSignature)
4949

5050
// baton->field
5151
if (info[2]->IsString()) {
52-
Nan::Utf8String field(Nan::To<v8::String>(info[2]).ToLocalChecked());
52+
Nan::Utf8String field(Nan::To<v8::String>(info[2]).ToLocalChecked());
5353
baton->field = (char *)malloc(field.length() + 1);
5454
memcpy((void *)baton->field, *field, field.length());
5555
baton->field[field.length()] = 0;

generate/templates/manual/filter_list/load.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ NAN_METHOD(GitFilterList::Load) {
6363
// start convert_from_v8 block
6464
const char *from_path = NULL;
6565

66-
Nan::Utf8String path(Nan::To<v8::String>(info[2]).ToLocalChecked());
66+
Nan::Utf8String path(Nan::To<v8::String>(info[2]).ToLocalChecked());
6767
// malloc with one extra byte so we can add the terminating null character
6868
// C-strings expect:
6969
from_path = (const char *)malloc(path.length() + 1);
@@ -144,7 +144,7 @@ void GitFilterList::LoadWorker::HandleOKCallback() {
144144

145145
for (uint32_t index = 0; index < propertyNames->Length(); ++index) {
146146
v8::Local<v8::String> propertyName = Nan::To<v8::String>(propertyNames->Get(index)).ToLocalChecked();
147-
Nan::Utf8String propertyNameAsUtf8Value(propertyName);
147+
Nan::Utf8String propertyNameAsUtf8Value(propertyName);
148148
const char *propertyNameAsCString = *propertyNameAsUtf8Value;
149149

150150
bool isNotMethodOnRegistry = strcmp("register", propertyNameAsCString)

generate/templates/manual/revwalk/file_history_walk.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ NAN_METHOD(GitRevwalk::FileHistoryWalk)
196196

197197
baton->error_code = GIT_OK;
198198
baton->error = NULL;
199-
Nan::Utf8String from_js_file_path(Nan::To<v8::String>(info[0]).ToLocalChecked());
199+
Nan::Utf8String from_js_file_path(Nan::To<v8::String>(info[0]).ToLocalChecked());
200200
baton->file_path = strdup(*from_js_file_path);
201201
baton->max_count = Nan::To<unsigned int>(info[1]).FromJust();
202202
baton->out = new std::vector<void *>;

generate/templates/manual/src/filter_registry.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ NAN_METHOD(GitFilterRegistry::GitFilterRegister) {
5555
FilterRegisterBaton *baton = new FilterRegisterBaton;
5656

5757
baton->filter = Nan::ObjectWrap::Unwrap<GitFilter>(Nan::To<v8::Object>(info[1]).ToLocalChecked())->GetValue();
58-
Nan::Utf8String name(Nan::To<v8::String>(info[0]).ToLocalChecked());
58+
Nan::Utf8String name(Nan::To<v8::String>(info[0]).ToLocalChecked());
5959

6060
baton->filter_name = (char *)malloc(name.length() + 1);
6161
memcpy((void *)baton->filter_name, *name, name.length());
@@ -144,7 +144,7 @@ NAN_METHOD(GitFilterRegistry::GitFilterUnregister) {
144144
}
145145

146146
FilterUnregisterBaton *baton = new FilterUnregisterBaton;
147-
Nan::Utf8String name(Nan::To<v8::String>(info[0]).ToLocalChecked());
147+
Nan::Utf8String name(Nan::To<v8::String>(info[0]).ToLocalChecked());
148148

149149
baton->filter_name = (char *)malloc(name.length() + 1);
150150
memcpy((void *)baton->filter_name, *name, name.length());

generate/templates/manual/src/str_array_converter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ git_strarray *StrArrayConverter::ConvertArray(Array *val) {
3737
git_strarray *result = AllocStrArray(val->Length());
3838

3939
for(size_t i = 0; i < result->count; i++) {
40-
Nan::Utf8String entry(val->Get(i));
40+
Nan::Utf8String entry(val->Get(i));
4141
result->strings[i] = strdup(*entry);
4242
}
4343

@@ -46,7 +46,7 @@ git_strarray *StrArrayConverter::ConvertArray(Array *val) {
4646

4747
git_strarray* StrArrayConverter::ConvertString(Local<String> val) {
4848
char *strings[1];
49-
Nan::Utf8String utf8String(val);
49+
Nan::Utf8String utf8String(val);
5050

5151
strings[0] = *utf8String;
5252

generate/templates/partials/convert_from_v8.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{%endif%}
2020
{%if cppClassName == 'String'%}
2121

22-
Nan::Utf8String {{ name }}(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
22+
Nan::Utf8String {{ name }}(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
2323
// malloc with one extra byte so we can add the terminating null character C-strings expect:
2424
from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1);
2525
// copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in
@@ -36,7 +36,7 @@
3636
from_{{ name }} = GitBufConverter::Convert(info[{{ jsArg }}]);
3737
{%elsif cppClassName == 'Wrapper'%}
3838

39-
Nan::Utf8String {{ name }}(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
39+
Nan::Utf8String {{ name }}(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
4040
// malloc with one extra byte so we can add the terminating null character C-strings expect:
4141
from_{{ name }} = ({{ cType }}) malloc({{ name }}.length() + 1);
4242
// copy the characters from the nodejs string into our C-string (used instead of strdup or strcpy because nulls in
@@ -69,7 +69,7 @@
6969
{%elsif cppClassName == 'GitOid'%}
7070
if (info[{{ jsArg }}]->IsString()) {
7171
// Try and parse in a string to a git_oid
72-
Nan::Utf8String oidString(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
72+
Nan::Utf8String oidString(Nan::To<v8::String>(info[{{ jsArg }}]).ToLocalChecked());
7373
git_oid *oidOut = (git_oid *)malloc(sizeof(git_oid));
7474

7575
if (git_oid_fromstr(oidOut, (const char *) strdup(*oidString)) != GIT_OK) {

generate/templates/partials/field_accessors.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
if (wrapper->GetValue()->{{ field.name }}) {
9393
}
9494

95-
Nan::Utf8String str(value);
95+
Nan::Utf8String str(value);
9696
wrapper->GetValue()->{{ field.name }} = strdup(*str);
9797

9898
{% elsif field.isCppClassIntType %}

0 commit comments

Comments
 (0)