[Pkg-javascript-commits] [node-lexical-scope] 64/83: fix to .toString() buffers
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:45:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-lexical-scope.
commit a3d39cd4bbe514a23c6e3fdf62ccc8cdd3a4a471
Author: James Halliday <mail at substack.net>
Date: Fri Jan 31 22:31:57 2014 -0800
fix to .toString() buffers
---
index.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/index.js b/index.js
index 7ce0e37..e38f222 100644
--- a/index.js
+++ b/index.js
@@ -8,6 +8,10 @@ module.exports = function (src) {
if (typeof src === 'string') {
src = String(src).replace(/^#![^\n]*\n/, '');
}
+ if (src && typeof src === 'object'
+ && typeof src.copy === 'function' && typeof src.toString === 'function') {
+ src = src.toString('utf8');
+ }
var walk = astw(src);
walk(function (node) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-lexical-scope.git
More information about the Pkg-javascript-commits
mailing list