[Pkg-javascript-commits] [node-lexical-scope] 42/83: Add failing test for right hand of object member

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:45:49 UTC 2017


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

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

commit 2f5754a522e80543bd39174d808adef8f6543be6
Author: ForbesLindesay <forbes at lindesay.co.uk>
Date:   Tue May 21 09:44:20 2013 +0100

    Add failing test for right hand of object member
---
 test/files/obj.js |  1 +
 test/obj.js       | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/test/files/obj.js b/test/files/obj.js
new file mode 100644
index 0000000..1e6900e
--- /dev/null
+++ b/test/files/obj.js
@@ -0,0 +1 @@
+module.exports = {foo: bar}
diff --git a/test/obj.js b/test/obj.js
new file mode 100644
index 0000000..64b8d5e
--- /dev/null
+++ b/test/obj.js
@@ -0,0 +1,16 @@
+var test = require('tape');
+var detect = require('../');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/obj.js');
+
+test('globals on the right-hand of a colon in an object literal', function (t) {
+    t.plan(3);
+    
+    var scope = detect(src);
+    t.same(
+        scope.globals.implicit.sort(),
+        [ 'bar', 'module' ].sort()
+    );
+    t.same(scope.globals.exported, []);
+    t.same(scope.locals, { '': [] });
+});

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



More information about the Pkg-javascript-commits mailing list