[Pkg-javascript-commits] [codemirror-js] 08/10: Patch syntax which causes a buble error

Gordon Ball chronitis-guest at moszumanska.debian.org
Fri Apr 6 13:28:35 UTC 2018


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

chronitis-guest pushed a commit to branch master
in repository codemirror-js.

commit c6ef03699ce493b39b010f39863c80370bccf0d5
Author: Gordon Ball <gordon at chronitis.net>
Date:   Fri Apr 6 11:34:20 2018 +0000

    Patch syntax which causes a buble error
    
    While this works with the package-specified rollup at 0.41 and
    rollup-plugin-buble at 0.15, as of the current debian versions (0.50 and
    0.19 respectively), this destructuring assignment causes an error.
    
    This patch simplifies the syntax so no transform is required.
---
 debian/patches/buble-syntax-error.patch | 18 ++++++++++++++++++
 debian/patches/series                   |  1 +
 2 files changed, 19 insertions(+)

diff --git a/debian/patches/buble-syntax-error.patch b/debian/patches/buble-syntax-error.patch
new file mode 100644
index 0000000..4d2c614
--- /dev/null
+++ b/debian/patches/buble-syntax-error.patch
@@ -0,0 +1,18 @@
+Description: fix an case for which buble generates invalid syntax
+Author: Gordon Ball <gordon at chronitis.net>
+
+--- a/src/model/changes.js
++++ b/src/model/changes.js
+@@ -263,7 +263,11 @@
+ 
+ export function replaceRange(doc, code, from, to, origin) {
+   if (!to) to = from
+-  if (cmp(to, from) < 0) [from, to] = [to, from]
++  if (cmp(to, from) < 0) {
++      let tmp = from;
++      to = from;
++      from = tmp;
++  }
+   if (typeof code == "string") code = doc.splitLines(code)
+   makeChange(doc, {from, to, text: code, origin})
+ }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..2007144
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+buble-syntax-error.patch

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



More information about the Pkg-javascript-commits mailing list