Javascript version in UE 18 ?

Help with writing and running scripts

Javascript version in UE 18 ?

Postby jorrasdk » Tue Mar 06, 2012 5:36 am

In the thread Script to find, remove and report repeating words within a line:

Mofi wrote:However, I found it interesting that there was no error on execution of your script because of function trim(). According to String methods documentation this method of the String object was added with Javascript 1.8.1 and IDM states in help that Javascript 1.7 is implemented in UltraEdit. I wrote this little script

Code: Select all
var sResult = "";
if (typeof(String.trim) != "function") sResult = " not";
UltraEdit.messageBox("String method trim is" + sResult + " supported.");

executed it and got the message "String method trim is supported." displayed. Very interesting. It looks like IDM has updated to a new version of the Javascript core without writing it anywhere. The questions are now: In which version was the Javascript core updated? And which Javascript version is now working in UltraEdit?


I had not read that thread until today. I also accidentally wrote some code with the trim() method and forgot to put in the normal prototype addition to the String object and wondered why it worked.

So have you Mofi or anyone else received any confirmation of the currently undocumented newer version of the Javascript engine in UE ?

I guess it must be 1.8.1 as reduce()/reduceRight() from version 1.8 and trim()/trimgRight()/trimLeft()/JSON from version 1.8.1 works, and Array.isArray() new to version 1.8.5 does not work. (As of UE 18.00.0.1017).

So IDM just need to document it and add the new methods to the standard javascript wordfile (javascript.uew). Has anyone written to them ? - otherwise I will do it.

Maybe a table could be added to the sticky JavaScript tutorial, power tips and more mapping javascript versions against UE versions ? - so scripts suggestions to users in this forum using older versions of UE doesn't include newer javascript methods.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Javascript version in UE 18 ?

Postby rhapdog » Tue Mar 06, 2012 8:28 am

jorrasdk wrote:Maybe a table could be added to the sticky JavaScript tutorial, power tips and more mapping javascript versions against UE versions ? - so scripts suggestions to users in this forum using older versions of UE doesn't include newer javascript methods.

I second that motion.
User avatar
rhapdog
Master
Master
 
Posts: 272
Joined: Tue Apr 01, 2008 10:02 am
Location: Mississippi, USA

Re: Javascript version in UE 18 ?

Postby jorrasdk » Tue Mar 06, 2012 8:57 am

I have sent IDM an e-mail asking if they will comment on the javascript engine version issue ? Stay tuned...
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Javascript version in UE 18 ?

Postby jorrasdk » Tue Mar 06, 2012 3:24 pm

Ok, Troy from IDM replied promptly, but were only able to give the answer that the javascript engine in UE v18.00 is defined as v1.8, not being sure what the exact version number is.

I'm satisfied with the fact that the String.prototype addition I probably used the most - trim() - now is part of the javascript engine in UE 18.00.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Javascript version in UE 18 ?

Postby danne » Mon Sep 10, 2012 8:26 am

Sorry for digging up a rather old thread (I am not very active here these days ; )

Anyways, I checked the uejs.dll file in 18.10.0.1016 and it says the version is 1.8.1.1 (fileinfo plugin for total commander). It lists the same version for 18.20.0.1014. Seems your assumptions would be correct about the JS version.
User avatar
danne
Basic User
Basic User
 
Posts: 36
Joined: Mon Feb 07, 2005 12:00 am

Re: Javascript version in UE 18 ?

Postby Mofi » Mon Sep 10, 2012 12:37 pm

I have analyzed all UE/UES versions which I have still archived (which are many) with reference to JavaScript version within uejs.dll and here are the results:

UE v15.20.0.1022 to UE v18.20.0.1014 and UES v9.30.0.1003 to UES v12.10.0.1003
JavaScript-C 1.8.0
pre-release 1 2007-10-03 (uejs.dll has 966.144 bytes, DLL has version 1.8.1.1)

UE v15.20.0.1020
JavaScript-C 1.8.0
pre-release 1 2007-10-03 (uejs.dll has 965.120 bytes, DLL has no version resource)

UE v13.00 to UE v15.20.0.1017 and UES v6.20 to UES v9.30.0.1002
JavaScript-C 1.7
pre-release 2 2006-11-19 (uejs.dll has 684.032 bytes, DLL has no version resource)

Latest versions on last update of this list were UE v18.20.0.1014 and UES v12.10.0.1003.

Those version strings found by searching for ASCII string "1.8" in binary uejs.dll are obviously the SpiderMonkey version strings of the JavaScript C/C++ library. Most likely the developers of SpiderMonkey have not kept this version string always up-to-date as comparison with the version in version resource let me suppose.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Scripts