nashorn/samples/prettyprinter.js
changeset 39662 e2b36a3779b9
parent 29541 efc10427bddc
equal deleted inserted replaced
39604:8e45018bde9d 39662:e2b36a3779b9
   207             println();
   207             println();
   208             indent();
   208             indent();
   209         }
   209         }
   210         print("function ");
   210         print("function ");
   211         if (func.name) {
   211         if (func.name) {
   212             print(func.name);
   212             print(func.name.name);
   213         }
   213         }
   214         printFunctionBody(func, extra, end);
   214         printFunctionBody(func, extra, end);
   215         if (funcDecl) {
   215         if (funcDecl) {
   216             println();
   216             println();
   217         }
   217         }
   606              }
   606              }
   607          },
   607          },
   608 
   608 
   609          visitVariable: function(node, extra) {
   609          visitVariable: function(node, extra) {
   610              indent();
   610              indent();
   611              print("var " + node.name);
   611              print("var " + node.binding.name);
   612              var init = node.initializer;
   612              var init = node.initializer;
   613              if (init) {
   613              if (init) {
   614                  print(" = ");
   614                  print(" = ");
   615                  if (init instanceof FunctionExpression) {
   615                  if (init instanceof FunctionExpression) {
   616                      printFunction(init, extra, "");
   616                      printFunction(init, extra, "");