From c45e978f7e6927e4d0a923b37dc46a02b2605f2d Mon Sep 17 00:00:00 2001 From: Remy Suen Date: Thu, 13 Jul 2017 05:11:19 +0900 Subject: [PATCH] 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 --- examples/details-for-tree-entry.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/details-for-tree-entry.js b/examples/details-for-tree-entry.js index 6c4a0dc28..a567fcf75 100644 --- a/examples/details-for-tree-entry.js +++ b/examples/details-for-tree-entry.js @@ -17,10 +17,10 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) var indexEntry = index.getByPath(treeEntry.path()); // With the index entry we can now view the details for the tree entry - console.log("Entry path: " + indexEntry.path()); - console.log("Entry time in seconds: " + indexEntry.mtime().seconds()); - console.log("Entry oid: " + indexEntry.id().toString()); - console.log("Entry size: " + indexEntry.fileSize()); + console.log("Entry path: " + indexEntry.path); + console.log("Entry time in seconds: " + indexEntry.mtime.seconds()); + console.log("Entry oid: " + indexEntry.id.toString()); + console.log("Entry size: " + indexEntry.fileSize); }); }); })