Jun 21, 2012 at 11:18 AM
Edited Jun 21, 2012 at 11:39 AM
|
Hi I just had a quick go trying to get envjs to work (as you probably know, it's a js implementation of a browser). I had a nutty plan to create an HTML+JS MVC view engine (I've managed to make a JS only view engine using jurassic).
Envjs apparently is only tested against Rhino JS so I was expecting some errors along the lines of CommonJs modules that aren't implemented.
Anyway, I opened up LinqPad, and downloaded env.js and nugetted in jurassic, and ran
void Main()
{
var engine = new Jurassic.ScriptEngine();
engine.ExecuteFile(@"C:\env.rhino.1.2.js");
}
I changed line 6778 from:
set body(){console.log('set body');/**in firefox this is a benevolent do nothing*/},
to
set body(v){console.log('set body');/**in firefox this is a benevolent do nothing*/},
in order to avoid a syntax error (but a weird one, as other setters are defined without a single argument). Then I re-ran it and got an error:
TypeError: 'b.__lookupGetter__' is not a function
at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
Which is some non standard thing: https://bugzilla.mozilla.org/show_bug.cgi?id=368453 which exists in Rhino. At this point I realised I was out of my depth.
Do you think you will ever be able to work on making envjs work on Jurassic? It would provide all kinds of things for .NET that aren't currently available (e.g. managed code web browser, my lovely view engine).
If not don't worry, thanks so much for the project!
edit: I have now seen from http://blog.nodejitsu.com/jsdom-jquery-in-5-lines-on-nodejs that
jsdom support would probably be enough for my view engine. I'm investigating that now.
edit 2: I think I'm out of my depth here. From
other posts on this forum it sounds like work needs to be done to get require.js to work, and that's just a dependency of jsdom!
|