Skip to content

Commit 4ef34a3

Browse files
tbranyenJohn Haley
authored andcommitted
Blame methods
1 parent 086b66c commit 4ef34a3

File tree

8 files changed

+36
-19
lines changed

8 files changed

+36
-19
lines changed

generate/descriptor.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
},
3131

3232
"blame": {
33-
"cType": null,
33+
"cType": "git_blame",
34+
"forwardDeclare": true,
3435

3536
"functions": {
3637
"git_blame_init_options": {
@@ -46,7 +47,7 @@
4647
},
4748

4849
"git_blame_get_hunk_byline": {
49-
"ignore": true
50+
"ignore": false
5051
},
5152

5253
"git_blame_file": {

generate/filters/cpp_to_v8.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
var isV8Value = require("./is_v8_value");
22

33
module.exports = function(cppClassName) {
4+
if (cppClassName === "Integer") {
5+
cppClassName = "Number";
6+
}
7+
48
return isV8Value(cppClassName) ? cppClassName : "Object";
59
};

generate/partials/convert_from_v8.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
if (args[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) {
66
{%endif%}
7-
{%if cppClassName == 'String' %}
7+
{%if cppClassName == 'String'%}
88

99
String::Utf8Value {{ name }}(args[{{ jsArg }}]->ToString());
1010
from_{{ name }} = ({{ cType }}) strdup(*{{ name }});
11-
{%elsif cppClassName == 'Array' %}
11+
{%elsif cppClassName == 'Array'%}
1212

1313
Array *tmp_{{ name }} = Array::Cast(*args[{{ jsArg }}]);
1414
from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }}));
@@ -18,8 +18,8 @@
1818
--%}
1919
from_{{ name }}[i] = ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(NanNew<Number>(static_cast<double>(i)))->ToObject())->GetValue();
2020
}
21-
{%elsif cppClassName == 'Function' %}
22-
{%elsif cppClassName == 'Buffer' %}
21+
{%elsif cppClassName == 'Function'%}
22+
{%elsif cppClassName == 'Buffer'%}
2323

2424
from_{{ name }} = Buffer::Data(args[{{ jsArg }}]->ToObject());
2525
{%elsif cppClassName|isV8Value %}

generate/partials/doc.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
2-
{%each args as arg %}
3-
{%if not arg.isReturn %}
4-
{%if not arg.isSelf %}
2+
{%each args as arg %}
3+
{%if not arg.isReturn %}
4+
{%if not arg.isSelf %}
55
* @param {{ arg.jsClassName }} {{ arg.name }}
6-
{%endif%}
7-
{%endif%}
8-
{%endeach%}{%each .|returnsInfo as returnInfo %}
9-
{%if isAsync %}
6+
{%endif%}
7+
{%endif%}
8+
{%endeach%}{%each .|returnsInfo as returnInfo %}
9+
{%if isAsync %}
1010
* @param {{ returnInfo.jsOrCppClassName }} callback
11-
{%else%}
11+
{%else%}
1212
* @return {{ returnInfo.jsOrCppClassName }} {%if returnInfo.name %}{{ returnInfo.name }}{%else%}result{%endif%}
13-
{%endif%}
14-
{%endeach%}
13+
{%endif%}
14+
{%endeach%}
1515
*/

generate/templates/binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
}
5151
]
5252
]
53-
},
53+
}
5454
]
5555
}

generate/templates/class_content.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This is a generated file, modify: generate/templates/class.cc.
1+
// This is a generated file, modify: generate/templates/class_content.cc.
22
#include <nan.h>
33
#include <string.h>
44

generate/templates/struct_content.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// This is a generated file, modify: generate/templates/class.cc.
1+
// This is a generated file, modify: generate/templates/struct_content.cc.
22
#include <nan.h>
33
#include <string.h>
44
#include <chrono>

generate/types.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9239,5 +9239,17 @@
92399239
"const git_cred_acquire_cb *": {
92409240
"cpp": "GitCredAcquireCb",
92419241
"js": "CredAcquireCb"
9242+
},
9243+
"git_blame_init_options": {
9244+
"cpp": "InitOptions",
9245+
"js": "initOptions"
9246+
},
9247+
"git_blame_init_options *": {
9248+
"cpp": "InitOptions",
9249+
"js": "initOptions"
9250+
},
9251+
"const git_blame_init_options *": {
9252+
"cpp": "InitOptions",
9253+
"js": "initOptions"
92429254
}
92439255
}

0 commit comments

Comments
 (0)