[Pkg-javascript-commits] [uglifyjs] 02/18: Add patch to break dependency loop by making source-map module optional. See bug#745687. Thanks to Jérémy Lal.

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 20:30:00 UTC 2014


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

js pushed a commit to branch master-experimental
in repository uglifyjs.

commit 65bca6ed327337f2cae0b980f3098ded585da6b1
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Fri May 2 09:25:39 2014 +0200

    Add patch to break dependency loop by making source-map module optional. See bug#745687. Thanks to Jérémy Lal.
---
 debian/patches/break_dep_loop.patch | 72 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 73 insertions(+)

diff --git a/debian/patches/break_dep_loop.patch b/debian/patches/break_dep_loop.patch
new file mode 100644
index 0000000..909cfe8
--- /dev/null
+++ b/debian/patches/break_dep_loop.patch
@@ -0,0 +1,72 @@
+Description: break dependency loop by making source-map module optional
+Forwarded: https://github.com/mishoo/UglifyJS2/pull/477
+Author: Jérémy Lal <kapouer at melix.org>
+Last-Update: 2014-05-02
+
+--- a/package.json
++++ b/package.json
+@@ -16,10 +16,12 @@
+     },
+     "dependencies": {
+         "async"      : "~0.2.6",
+-        "source-map" : "~0.1.33",
+         "optimist"   : "~0.3.5",
+         "uglify-to-browserify": "~1.0.0"
+     },
++    "optionalDependencies": {
++        "source-map" : "~0.1.33"
++    },
+     "browserify": {
+         "transform": [ "uglify-to-browserify" ]
+     },
+--- a/tools/node.js
++++ b/tools/node.js
+@@ -2,11 +2,16 @@
+ var fs = require("fs");
+ var vm = require("vm");
+ var sys = require("util");
++var sourceMap;
++try {
++	sourceMap = require("source-map");
++} catch(e) {
++}
+ 
+ var UglifyJS = vm.createContext({
+     sys           : sys,
+     console       : console,
+-    MOZ_SourceMap : require("source-map")
++    MOZ_SourceMap : sourceMap
+ });
+ 
+ function load_global(file) {
+@@ -107,17 +112,21 @@
+         inMap = fs.readFileSync(options.inSourceMap, "utf8");
+     }
+     if (options.outSourceMap) {
+-        output.source_map = UglifyJS.SourceMap({
+-            file: options.outSourceMap,
+-            orig: inMap,
+-            root: options.sourceRoot
+-        });
+-        if (options.sourceMapIncludeSources) {
+-            for (var file in sourcesContent) {
+-                if (sourcesContent.hasOwnProperty(file)) {
+-                    options.source_map.get().setSourceContent(file, sourcesContent[file]);
++        if (sourceMap) {
++            output.source_map = UglifyJS.SourceMap({
++                file: options.outSourceMap,
++                orig: inMap,
++                root: options.sourceRoot
++            });
++            if (options.sourceMapIncludeSources) {
++                for (var file in sourcesContent) {
++                    if (sourcesContent.hasOwnProperty(file)) {
++                        options.source_map.get().setSourceContent(file, sourcesContent[file]);
++                    }
+                 }
+             }
++        } else {
++            console.error("source-map module is missing and needed by outSourceMap option");
+         }
+ 
+     }
diff --git a/debian/patches/series b/debian/patches/series
index 9da4119..caf2b9c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fix_lib_path.patch
 node_conflict.patch
+break_dep_loop.patch

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



More information about the Pkg-javascript-commits mailing list