Skip to content

Commit

Permalink
failing test since global assignment in index relies on global for …
Browse files Browse the repository at this point in the history
…scoping
  • Loading branch information
James Halliday committed Dec 10, 2013
1 parent 6b2f8f1 commit 05be36a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/undef_globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var test = require('tape');
var vm = require('vm');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/../index.js', 'utf8');

test('u8a without globals', function (t) {
var c = {
module: { exports: {} }
};
vm.runInNewContext('(function(){' + src + '}).call(module.exports)', c);
var TA = c.module.exports;
var ua = new(TA.Uint8Array)(5);

t.equal(ua.length, 5);
ua[1] = 256 + 55;
t.equal(ua[1], 55);
t.end();
});

0 comments on commit 05be36a

Please sign in to comment.