[Pkg-javascript-commits] [pdf.js] 46/161: Fix coding style in external/builder/builder.js

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 14:16:22 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 4f6b363b2cd05ade230515e022540e05bb566935
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Mon Mar 10 15:53:41 2014 +0100

    Fix coding style in external/builder/builder.js
---
 external/builder/builder.js | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/external/builder/builder.js b/external/builder/builder.js
index a7fd887..69b5d78 100644
--- a/external/builder/builder.js
+++ b/external/builder/builder.js
@@ -1,3 +1,5 @@
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
 /* jshint node:true */
 /* globals cp, ls, test */
 
@@ -32,10 +34,10 @@ function preprocess(inFilename, outFilename, defines) {
     }
     return null;
   }
-  var writeLine = typeof outFilename === 'function' ? outFilename :
-                                                      function(line) {
-    out += line + '\n';
-  };
+  var writeLine = (typeof outFilename === 'function' ? outFilename :
+    function(line) {
+      out += line + '\n';
+    });
   function include(file) {
     var realPath = fs.realpathSync(inFilename);
     var dir = path.dirname(realPath);
@@ -78,12 +80,14 @@ function preprocess(inFilename, outFilename, defines) {
           state = stack.pop();
           break;
         case 'expand':
-          if (state === 0 || state === 3)
+          if (state === 0 || state === 3) {
             expand(m[2]);
+          }
           break;
         case 'include':
-          if (state === 0 || state === 3)
+          if (state === 0 || state === 3) {
             include(m[2]);
+          }
           break;
       }
     } else {
@@ -94,10 +98,12 @@ function preprocess(inFilename, outFilename, defines) {
       }
     }
   }
-  if (state !== 0 || stack.length !== 0)
+  if (state !== 0 || stack.length !== 0) {
     throw new Error('Missing endif in preprocessor.');
-  if (typeof outFilename !== 'function')
+  }
+  if (typeof outFilename !== 'function') {
     fs.writeFileSync(outFilename, out);
+  }
 }
 exports.preprocess = preprocess;
 
@@ -198,8 +204,9 @@ function build(setup) {
     sources.forEach(function(source) {
       // ??? Warn if the source is wildcard and dest is file?
       var destWithFolder = destination;
-      if (test('-d', destination))
+      if (test('-d', destination)) {
         destWithFolder += '/' + path.basename(source);
+      }
       preprocess(source, destWithFolder, defines);
     });
   });
@@ -219,10 +226,12 @@ exports.build = build;
  */
 function merge(defaults, defines) {
   var ret = {};
-  for (var key in defaults)
+  for (var key in defaults) {
     ret[key] = defaults[key];
-  for (key in defines)
+  }
+  for (key in defines) {
     ret[key] = defines[key];
+  }
   return ret;
 }
 exports.merge = merge;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list