-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
failing test since
global
assignment in index relies on global for …
…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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |