Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
asvd committed Jun 13, 2016
2 parents 3d8340f + 4b508dc commit 0d0d1ad
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
11 changes: 5 additions & 6 deletions lib/jailed.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@


var __jailed__path__;
if (typeof window == 'undefined') {
var __is__node__ = ((typeof process !== 'undefined') &&
(!process.browser) &&
(process.release.name.search(/node|io.js/) !== -1));
if (__is__node__) {
// Node.js
__jailed__path__ = __dirname + '/';
} else {
Expand All @@ -44,10 +47,6 @@ if (typeof window == 'undefined') {
factory((root.jailed = {}));
}
}(this, function (exports) {
var isNode = ((typeof process !== 'undefined') &&
(!process.browser) &&
(process.release.name.search(/node|io.js/) !== -1));

/**
* A special kind of event:
* - which can only be emitted once;
Expand Down Expand Up @@ -403,7 +402,7 @@ if (typeof window == 'undefined') {
}


if (isNode) {
if (__is__node__) {
initNode();
basicConnectionNode();
} else {
Expand Down
9 changes: 6 additions & 3 deletions tests/lighttest.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@
*/
lighttest._platform.init = function () {
if (!lighttest._platform._initialized) {
if (typeof window != 'undefined') {
lighttest._platform._initWeb();
} else {
var __is__node__ = ((typeof process !== 'undefined') &&
(!process.browser) &&
(process.release.name.search(/node|io.js/) !== -1));
if (__is__node__) {
lighttest._platform._initNode();
} else {
lighttest._platform._initWeb();
}
lighttest._platform._initialized = true;
}
Expand Down
6 changes: 4 additions & 2 deletions tests/tests.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
var isNode = typeof window == 'undefined';
var __is__node__ = ((typeof process !== 'undefined') &&
(!process.browser) &&
(process.release.name.search(/node|io.js/) !== -1));
var currentPath;

var whenFailed = function(){
lighttest.check(false);
lighttest.done();
}

if (isNode) {
if (__is__node__) {
currentPath = __dirname + '/';
} else {
var scripts = document.getElementsByTagName('script');
Expand Down

0 comments on commit 0d0d1ad

Please sign in to comment.