[Pkg-javascript-commits] [acorn] 02/03: Add patch to avoid use of destructuring assignments

Julien Puydt julien.puydt at laposte.net
Tue Dec 13 16:01:08 UTC 2016


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

jpuydt-guest pushed a commit to branch master
in repository acorn.

commit 966db1c1d158b04d8f000d4cbc66af47793a5cb3
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Tue Dec 13 15:34:48 2016 +0100

    Add patch to avoid use of destructuring assignments
---
 debian/changelog                              |  1 +
 debian/patches/destructuring_assignment.patch | 33 +++++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 35 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 0d37f04..e800257 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 acorn (4.0.3-2) UNRELEASED; urgency=medium
 
   * Add patch to remove use of default arguments. (Closes: #847789)
+  * Add patch to remove use of destructuring assignmants.
 
  -- Julien Puydt <julien.puydt at laposte.net>  Mon, 12 Dec 2016 10:39:18 +0100
 
diff --git a/debian/patches/destructuring_assignment.patch b/debian/patches/destructuring_assignment.patch
new file mode 100644
index 0000000..4f42577
--- /dev/null
+++ b/debian/patches/destructuring_assignment.patch
@@ -0,0 +1,33 @@
+Description: avoid the use of destructuring assignments (Debian's nodejs is old)
+Author: Julien Puydt
+Forwarded: no
+
+--- a/src/expression.js
++++ b/src/expression.js
+@@ -30,13 +30,13 @@
+ pp.checkPropClash = function(prop, propHash) {
+   if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
+     return
+-  let {key} = prop, name
++  let key = prop.key, name
+   switch (key.type) {
+   case "Identifier": name = key.name; break
+   case "Literal": name = String(key.value); break
+   default: return
+   }
+-  let {kind} = prop
++  let kind = prop.kind
+   if (this.options.ecmaVersion >= 6) {
+     if (name === "__proto__" && kind === "init") {
+       if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property")
+--- a/src/statement.js
++++ b/src/statement.js
+@@ -517,7 +517,7 @@
+     method.kind = "method"
+     let isGetSet = false
+     if (!method.computed) {
+-      let {key} = method
++      let key = method.key
+       if (!isGenerator && !isAsync && key.type === "Identifier" && this.type !== tt.parenL && (key.name === "get" || key.name === "set")) {
+         isGetSet = true
+         method.kind = key.name
diff --git a/debian/patches/series b/debian/patches/series
index 618e8a4..9a7f8ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 default_arg.patch
+destructuring_assignment.patch

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



More information about the Pkg-javascript-commits mailing list