1. Brian McKenna
  2. roy

Commits

joneshf  committed 633af0b

Fixed blank lines in repl.

  • Participants
  • Parent commits 07d50d7
  • Branches constraints

Comments (0)

Files changed (1)

File src/node-repl.js

View file
                 // Remember the source if it's a binding
                 tokens = lexer.tokenise(line);
                 ast = parser.parse(tokens);
-                ast.body[0].accept({
-                    visitLet: function(n) {
-                        sources[n.name] = n.value;
-                    }
-                });
+                if (typeof ast.body[0] != 'undefined') {
+                    ast.body[0].accept({
+                        visitLet: function(n) {
+                            sources[n.name] = n.value;
+                        }
+                    });
+                }
 
                 // Just eval it
                 compiled = compile(line, env, aliases, {nodejs: true, filename: ".", run: true});