FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Change function calls to field accesses instead · CodeHunterDev/nodegit@c45e978 · GitHub

Repository navigation

Commit c45e978

Browse files
committed
Change function calls to field accesses instead
In details-for-tree-entry.js, there are several calls to functions of an IndexEntry. However, those are actually fields on an object instead of prototype functions so referring to them as functions will cause a ReferenceError to be thrown. The fix is to not refer to them as functions but to simply refer to them as fields instead. Signed-off-by: Remy Suen <remy.suen@gmail.com>
1 parent 4611ca7 commit c45e978

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎examples/details-for-tree-entry.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git"))
1717
var indexEntry = index.getByPath(treeEntry.path());
1818

1919
// With the index entry we can now view the details for the tree entry
20-
console.log("Entry path: " + indexEntry.path());
21-
console.log("Entry time in seconds: " + indexEntry.mtime().seconds());
22-
console.log("Entry oid: " + indexEntry.id().toString());
23-
console.log("Entry size: " + indexEntry.fileSize());
20+
console.log("Entry path: " + indexEntry.path);
21+
console.log("Entry time in seconds: " + indexEntry.mtime.seconds());
22+
console.log("Entry oid: " + indexEntry.id.toString());
23+
console.log("Entry size: " + indexEntry.fileSize);
2424
});
2525
});
2626
})

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL