From 39f277f7267c0b36f2e82a02728dfcf139ec8d15 Mon Sep 17 00:00:00 2001 From: Ken McHugh Date: Tue, 10 Jan 2012 20:22:34 +0800 Subject: [PATCH] Fix to allow compilation with rhino while using asual lesscss engine --- lib/less/parser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index e0cf9830..a6712c22 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -3,7 +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 - less = {}; + if (typeof(window) === 'undefined') { window.less = {} } + less = window.less || {}; tree = less.tree = {}; less.mode = 'rhino'; } else if (typeof(window) === 'undefined') {