[Pkg-javascript-commits] [node-lexical-scope] 48/83: Added test case for label statements

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:45:50 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 35e544fdf0435368097975a29084054056e56d32
Author: Mikola Lysenko <mikolalysenko at gmail.com>
Date:   Wed Jun 5 13:34:21 2013 -0500

    Added test case for label statements
---
 test/files/labels.js | 11 +++++++++++
 test/labels.js       | 13 +++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/test/files/labels.js b/test/files/labels.js
new file mode 100644
index 0000000..bcef49b
--- /dev/null
+++ b/test/files/labels.js
@@ -0,0 +1,11 @@
+test_label1: while(true) {
+  break test_label1;
+  continue test_label1;
+}
+
+function nest() {
+test_label2: while(true) {
+    break test_label2;
+    continue test_label2;
+  }
+};
\ No newline at end of file
diff --git a/test/labels.js b/test/labels.js
new file mode 100644
index 0000000..830497a
--- /dev/null
+++ b/test/labels.js
@@ -0,0 +1,13 @@
+var test = require('tape');
+var detect = require('../');
+var fs = require('fs');
+var src = fs.readFileSync(__dirname + '/files/labels.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, []);
+    t.same(scope.globals.exported, []);
+    t.same(scope.locals, { '': [ 'nest' ], 'body.1': [] });
+});

-- 
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