Unverified Commit 708b9dd8 authored by Tyler Wanek's avatar Tyler Wanek Committed by GitHub

Merge pull request #1354 from jmurzy/fix-rerequre

fix issue with re-require()'ing native modules
parents 4d91e113 a71d97cb
var _ = require("lodash");
var promisify = require("promisify-node");
var rawApi;
......@@ -15,6 +16,12 @@ catch (ex) {
rawApi = require("../build/Debug/nodegit.node");
}
// For disccussion on why `cloneDeep` is required, see:
// https://github.com/facebook/jest/issues/3552
// https://github.com/facebook/jest/issues/3550
// https://github.com/nodejs/node/issues/5016
rawApi = _.cloneDeep(rawApi);
// Native methods do not return an identifiable function, so we
// have to override them here
/* jshint ignore:start */
......
......@@ -2,7 +2,8 @@ var NodeGit = require("../");
var Revwalk = NodeGit.Revwalk;
Object.defineProperty(Revwalk.prototype, "repo", {
get: function () { return this.repository(); }
get: function () { return this.repository(); },
configurable: true
});
var _sorting = Revwalk.prototype.sorting;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment