Fix browser tests on Node.js 0.10

This commit is contained in:
Miroslav Bajtoš 2017-03-24 12:04:25 +01:00
parent 9cb3d0648b
commit 67c4f1e1a3
No known key found for this signature in database
GPG Key ID: 797723F23CE0A94A
1 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,12 @@ function createContext() {
// `window` is used by loopback to detect browser runtime
context.window = context;
// In Node.js 0.10, the Uint8Array is provided by Node.js glue,
// it's not available in the V8 runtime itself
if (/^v0\.10/.test(process.version)) {
context.Uint8Array = Uint8Array;
}
return vm.createContext(context);
}
exports.createContext = createContext;