[Pkg-javascript-commits] [node-detective] 05/09: update acorn version to better handle the object pattern (#72)

Bastien Roucariès rouca at moszumanska.debian.org
Thu Nov 30 10:43:07 UTC 2017


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

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

commit f2786cb8b670d6f8a9a1964127856c905f49952d
Author: Alexis Tessier <alexistessierdev at gmail.com>
Date:   Sun Nov 26 20:07:07 2017 +0100

    update acorn version to better handle the object pattern (#72)
    
    * update acorn version to better handle the object pattern
    
    * remove package-lock and use ^ semver operator on acorn dependency
---
 package.json                        |  2 +-
 test/files/set-in-object-pattern.js | 10 ++++++++++
 test/set-in-object-pattern.js       | 12 ++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/package.json b/package.json
index d10cf40..090d3b3 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
     "test": "tap test/*.js"
   },
   "dependencies": {
-    "acorn": "^4.0.3",
+    "acorn": "^5.2.1",
     "defined": "^1.0.0"
   },
   "devDependencies": {
diff --git a/test/files/set-in-object-pattern.js b/test/files/set-in-object-pattern.js
new file mode 100644
index 0000000..fa507b0
--- /dev/null
+++ b/test/files/set-in-object-pattern.js
@@ -0,0 +1,10 @@
+var a = load('a');
+var b = load('b');
+var c = load('c');
+var abc = a.b(c);
+
+function load2({set = 'hello'}) {
+	return load('tt');
+}
+
+var loadUse = load2();
diff --git a/test/set-in-object-pattern.js b/test/set-in-object-pattern.js
new file mode 100644
index 0000000..4787b1e
--- /dev/null
+++ b/test/set-in-object-pattern.js
@@ -0,0 +1,12 @@
+var test = require('tap').test;
+var detective = require('../');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/set-in-object-pattern.js');
+
+test('set in object pattern', function (t) {
+    t.deepEqual(
+        detective(src, { word : 'load' }),
+        [ 'a', 'b', 'c', 'tt' ]
+    );
+    t.end();
+});
\ No newline at end of file

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



More information about the Pkg-javascript-commits mailing list