refactor rhino setup logic

This commit is contained in:
Alexis Sellier
2012-01-10 21:58:52 +01:00
parent 6196a225cb
commit 4cb962c5cd

View File

@@ -3,8 +3,8 @@ var less, tree;
if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") {
// Rhino
// Details on how to detect Rhino: https://github.com/ringo/ringojs/issues/88
if (typeof(window) != 'undefined') { window.less = {} }
less = typeof(window) != 'undefined' ? window.less : {};
if (typeof(window) === 'undefined') { less = {} }
else { less = window.less = {} }
tree = less.tree = {};
less.mode = 'rhino';
} else if (typeof(window) === 'undefined') {