Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Incorrect use of call in Glossary.prototype.root #4

Open
shellscape opened this issue Aug 16, 2017 · 0 comments
Open

Incorrect use of call in Glossary.prototype.root #4

shellscape opened this issue Aug 16, 2017 · 0 comments

Comments

@shellscape
Copy link

As the module sits right now, the call to .root(__dirname, '..') will result in:

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received [ '<path>', '..' ]

The fix is:

Glossary.prototype.root = function () {
  const args = Array.prototype.slice.call(arguments);
  this._attrs.root = path.resolve.apply(path, args);
  return this;
};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant