[Pkg-javascript-commits] [node-detective] 70/119: fixing noargs function case
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:44:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-detective.
commit 51f04d08e9a60e82d7d2168f048b85792deabcfa
Author: Thorsten Lorenz <thlorenz at gmx.de>
Date: Wed Feb 26 11:11:27 2014 -0500
fixing noargs function case
---
index.js | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/index.js b/index.js
index 49000c9..47efdfc 100644
--- a/index.js
+++ b/index.js
@@ -55,12 +55,13 @@ exports.find = function (src, opts) {
walk(src, opts.parse, function (node) {
if (!isRequire(node)) return;
- if (node.arguments.length
- && node.arguments[0].type === 'Literal') {
- modules.strings.push(node.arguments[0].value);
- }
- else {
- modules.expressions.push(escodegen.generate(node.arguments[0]));
+ if (node.arguments.length) {
+ if (node.arguments[0].type === 'Literal') {
+ modules.strings.push(node.arguments[0].value);
+ }
+ else {
+ modules.expressions.push(escodegen.generate(node.arguments[0]));
+ }
}
if (opts.nodes) modules.nodes.push(node);
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-detective.git
More information about the Pkg-javascript-commits
mailing list