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.





