File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /*
2- Copyright (c) 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
3- */
1+ /* *
2+ * Copyright (c) 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
3+ * @author Michael Robinson @codeofinterest <mike@pagesofinterest.net>
4+ *
5+ * Dual licensed under the MIT and GPL licenses.
6+ */
47
58#ifndef REF_H
69#define REF_H
@@ -19,7 +22,7 @@ using namespace v8;
1922
2023class GitReference : public ObjectWrap {
2124 public:
22- static Persistent<FunctionTemplate > constructor_template;
25+ static Persistent<Function > constructor_template;
2326 static void Initialize (Handle<v8::Object> target);
2427 git_reference* GetValue ();
2528 void SetValue (git_reference* ref);
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ exports.repo = require("./repo.js").repo;
1515exports . sig = require ( "./sig.js" ) . sig ;
1616exports . oid = require ( "./oid.js" ) . oid ;
1717exports . object = require ( "./object.js" ) . object ;
18- exports . ref = require ( "./reference.js" ) . ref ;
18+ exports . reference = require ( "./reference.js" ) . reference ;
1919exports . revwalk = require ( "./revwalk.js" ) . revwalk ;
2020exports . commit = require ( "./commit.js" ) . commit ;
2121exports . tree = require ( "./tree.js" ) . tree ;
Original file line number Diff line number Diff line change @@ -21,16 +21,16 @@ using namespace node;
2121void GitReference::Initialize (Handle<Object> target) {
2222 HandleScope scope;
2323
24- Local<FunctionTemplate> t = FunctionTemplate::New (New);
24+ Local<FunctionTemplate> tpl = FunctionTemplate::New (New);
2525
26- constructor_template = Persistent<FunctionTemplate>::New (t);
27- constructor_template->InstanceTemplate ()->SetInternalFieldCount (1 );
28- constructor_template->SetClassName (String::NewSymbol (" Ref" ));
26+ tpl->InstanceTemplate ()->SetInternalFieldCount (1 );
27+ tpl->SetClassName (String::NewSymbol (" Reference" ));
2928
30- NODE_SET_PROTOTYPE_METHOD (constructor_template , " oid" , Oid);
31- NODE_SET_PROTOTYPE_METHOD (constructor_template , " lookup" , Lookup);
29+ NODE_SET_PROTOTYPE_METHOD (tpl , " oid" , Oid);
30+ NODE_SET_PROTOTYPE_METHOD (tpl , " lookup" , Lookup);
3231
33- target->Set (String::NewSymbol (" Ref" ), constructor_template->GetFunction ());
32+ constructor_template = Persistent<Function>::New (tpl->GetFunction ());
33+ target->Set (String::NewSymbol (" Reference" ), constructor_template);
3434}
3535
3636git_reference* GitReference::GetValue () {
You can’t perform that action at this time.
0 commit comments