Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80542 views
1
var test = require('tape');
2
var detect = require('../');
3
var fs = require('fs');
4
var src = fs.readFileSync(__dirname + '/files/obj.js');
5
6
test('globals on the right-hand of a colon in an object literal', function (t) {
7
t.plan(3);
8
9
var scope = detect(src);
10
t.same(
11
scope.globals.implicit.sort(),
12
[ 'bar', 'module' ].sort()
13
);
14
t.same(scope.globals.exported, []);
15
t.same(scope.locals, { '': [] });
16
});
17
18