[Pkg-javascript-commits] [node-browser-pack] 42/141: fix the order by setting the index exactly instead of splicing

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:23 UTC 2017


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

rouca pushed a commit to branch master
in repository node-browser-pack.

commit 9150a5abc52274dabe66cf71f500d9b26f383425
Author: James Halliday <mail at substack.net>
Date:   Sun Mar 31 23:56:02 2013 -0700

    fix the order by setting the index exactly instead of splicing
---
 index.js     | 3 ++-
 package.json | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index d38d368..0740650 100644
--- a/index.js
+++ b/index.js
@@ -62,13 +62,14 @@ module.exports = function (opts) {
         
         first = false;
         if (row.entry && row.order !== undefined) {
-            entries.splice(row.order, 0, row.id);
+            entries[row.order] = row.id;
         }
         else if (row.entry) entries.push(row.id);
     }
     
     function end () {
         if (first) this.queue(prelude);
+        entries = entries.filter(function (x) { return x !== undefined });
         
         this.queue('},{},' + JSON.stringify(entries) + ')');
         if (sourcemap) this.queue('\n' + sourcemap.comment());
diff --git a/package.json b/package.json
index 7995e3e..c9f1212 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "browser-pack",
-    "version": "0.7.0",
+    "version": "0.7.1",
     "description": "pack node-style source files from a json stream into a browser bundle",
     "main": "index.js",
     "bin": {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list