Permalink
Browse files

with the recent shell-emulation changes, these hacks should no longer…

… be needed
  • Loading branch information...
1 parent 10b29eb commit ea1d4bb625ab56650b6dec211275d623f7b113dc @softprops softprops committed Feb 4, 2012
Showing with 2 additions and 11 deletions.
  1. +2 −11 src/main/resources/less-rhino-1.1.5.js
@@ -2423,25 +2423,16 @@ require('./tree').jsify = function (obj) {
// reference to the name in as argument in compile function
var name;
-// the use of readFile below will result in an undefined error
-// because this script is not being run via rhino's shell
-// the work around is to capture an instance of rhinos
-// shell and reference readFile as a member of that instance
-// http://blog.echo-flow.com/2010/09/29/scxml-js-build-adventures/
-var rshell = org.mozilla.javascript.tools.shell.Main;
-rshell.exec(["-e","var a='STRING';"]);
-var rshellGlobal = rshell.global;
-
function loadStyleSheet(sheet, callback, reload, remaining) {
var sheetName = name.slice(0, name.lastIndexOf('/') + 1) + sheet.href;
- var input = rshellGlobal.readFile(sheetName);
+ var input = readFile(sheetName);
var parser = new less.Parser();
var savedName = name;
name = sheetName;
parser.parse(input, function (e, root) {
if (e) {
print("Error: " + e);
- rshellGlobal.quit(1);
+ quit(1);
}
callback(root, sheet, { local: false, lastModified: 0, remaining: remaining });
});

0 comments on commit ea1d4bb

Please sign in to comment.