Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
voidcheck string pointers and reenable attr test
  • Loading branch information
maxkorp committed Nov 11, 2014
commit eeb5f77518da9501610f9c96e0e0a4bb35a593ed
8 changes: 8 additions & 0 deletions generate/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"functions": {
"git_attr_foreach": {
"ignore": true
},
"git_attr_get": {
"isAsync": true,
"args": {
"value_out": {
"isReturn": true
}
}
}
}
},
Expand Down
12 changes: 9 additions & 3 deletions generate/partials/convert_to_v8.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// start convert_to_v8 block
{%if cppClassName == 'String' %}
if ({{= parsedName =}}){
{%if size %}
to = NanNew<String>({{= parsedName =}}, {{ size }});
to = NanNew<String>({{= parsedName =}}, {{ size }});
{%elsif cType == 'char **' %}
to = NanNew<String>(*{{= parsedName =}});

to = NanNew<String>(*{{= parsedName =}});
{%else%}
to = NanNew<String>({{= parsedName =}});
to = NanNew<String>({{= parsedName =}});
{%endif%}
}
else {
to = NanNull();
}

{%if freeFunctionName %}
{{ freeFunctionName }}({{= parsedName =}});
Expand Down
11 changes: 2 additions & 9 deletions test/tests/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,8 @@ describe("Attr", function() {
Attr.cacheFlush(this.repository);
});

// FIXME Currently segfaults.
it.skip("can lookup the value of a git attribute", function() {
it("can lookup the value of a git attribute", function() {
var flags = Attr.Check.NO_SYSTEM;
var getAttr = Attr.get(this.repository, flags, ".gitattributes", "test");

return getAttr.then(function(val) {
console.log(val);
}).catch(function(ex) {
console.log(ex);
});
Attr.get(this.repository, flags, ".gitattributes", "test");
});
});