[Pkg-javascript-commits] [node-magic-string] 01/01: Add patch to avoid optional arguments
Julien Puydt
julien.puydt at laposte.net
Mon Jul 24 08:51:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
jpuydt-guest pushed a commit to branch master
in repository node-magic-string.
commit ba33354cd865c220f69f183c45c26952349ad1ed
Author: Julien Puydt <julien.puydt at laposte.net>
Date: Mon Jul 24 10:37:38 2017 +0200
Add patch to avoid optional arguments
---
debian/changelog | 6 +++++
debian/patches/optional_argument.patch | 49 ++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 56 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 12e96d1..5582c30 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+node-magic-string (0.22.3-2) unstable; urgency=medium
+
+ * Added a patch to avoid optional arguments (Closes: #869530).
+
+ -- Julien Puydt <julien.puydt at laposte.net> Mon, 24 Jul 2017 10:36:42 +0200
+
node-magic-string (0.22.3-1) unstable; urgency=medium
* New upstream release.
diff --git a/debian/patches/optional_argument.patch b/debian/patches/optional_argument.patch
new file mode 100644
index 0000000..87e34ba
--- /dev/null
+++ b/debian/patches/optional_argument.patch
@@ -0,0 +1,49 @@
+Description: don't use optional arguments to work with older nodejs
+Author: Julien Puydt
+Forwarded: no
+
+--- a/src/MagicString.js
++++ b/src/MagicString.js
+@@ -13,7 +13,8 @@
+ storeName: false
+ };
+
+-export default function MagicString ( string, options = {} ) {
++export default function MagicString ( string, options) {
++ if (!options) options = {};
+ const chunk = new Chunk( 0, string.length, string );
+
+ Object.defineProperties( this, {
+@@ -455,7 +456,9 @@
+ return this;
+ },
+
+- slice ( start = 0, end = this.original.length ) {
++ slice ( start, end ) {
++ if (!start) start = 0;
++ if (!end) end = this.original.length;
+ while ( start < 0 ) start += this.original.length;
+ while ( end < 0 ) end += this.original.length;
+
+--- a/src/Bundle.js
++++ b/src/Bundle.js
+@@ -6,7 +6,8 @@
+ import getLocator from './utils/getLocator.js';
+ import Mappings from './utils/Mappings.js';
+
+-export default function Bundle ( options = {} ) {
++export default function Bundle ( options ) {
++ if (!options) options = {};
+ this.intro = options.intro || '';
+ this.separator = options.separator !== undefined ? options.separator : '\n';
+
+@@ -80,7 +81,8 @@
+ return bundle;
+ },
+
+- generateMap ( options = {} ) {
++ generateMap ( options ) {
++ if (!options) options = {};
+ const names = [];
+ this.sources.forEach( source => {
+ Object.keys( source.content.storedNames ).forEach( name => {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..55be9d9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+optional_argument.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-magic-string.git
More information about the Pkg-javascript-commits
mailing list