No errors with WebView2?

No errors with WebView2?

201
Basic UserBasic User
201

    15:27 - May 25#1

    Hello insider,

    Now the new engine is finally working for me since the last or penultimate update of UltraEdit. See How to use new JavaScript engine in UltraEdit for Windows 2023.0?

    I have now realized while ‘playing around’ and trying it out that I no longer get any error messages at all, even if the code only contains ‘nonsense’?

    Example:

    Code: Select all

    // @Engine=WebView2
    'use strict';
    consts _ue         = UltraEdit;
    
    klkfgdsfwr 
    
    main();
    
    function main() {
    }
    
    The output window shows : Script succeeded ?

    I would now have to comment out // @Engine=WebView2 with ‘////...’ so that I at least get an error (with line) displayed.
    However, if the code was written for the new engine, this procedure will of course also generate errors for the new functions etc.

    Do I now have a general comprehension problem?
    Does something still have to be set somewhere?

    If nothing is possible, then this means that the UltraEdit is less suitable for programming in JavaScript, as it makes troubleshooting more difficult.

    BTW: Why is it actually not possible to output error numbers? Even Directory Opus with its 20 year old script engine can do this much better. There I also get the error number in addition to the line number.

    Greetings Frank
    (Translated with DeepL)
    Win10 Pro (64bit) 22H2 - UE 2024.0.0.28 64-bit

    6,654559
    Grand MasterGrand Master
    6,654559

      17:56 - May 25#2

      I still write UltraEdit scripts published here with compatibility for the old version of SpiderMonkey JavaScript engine embedded in UltraEdit/UEStudio (Mozilla JavaScript version 1.8.1 / ECMAScript version 3.1) for maximum compatibility with older versions of UltraEdit and older versions of Windows with no support for WebView2.

      I detected like you on beta testing the WebView2 only enhancements of UltraEdit for Windows v2024.0 that no error is ever reported to the output window on running an UltraEdit script with using the WebView2 engine. I sent following two reports by email to UltraEdit support within 20 minutes.
      Mofi wrote:Serious syntax error not reported by UltraEdit on usage of WebView2 engine

      I am testing UltraEdit 2024.0.0.21 64-bit Beta 3 on Windows 11 23H2.

      I wrote the following small script:

      I removed the not working script as it is not important for this topic and I don't want non-working scripts posted in the forums.

      I executed this script on a copy of changes.txt in F:\Temp opened in UltraEdit 2024.0 Beta 3. Nothing changed on the file F:\Temp\changes.txt.

      I opened the output window and displayed was:

      Code: Select all

      Scripting Engine: Using WebView2
      Running script: F:\Temp\Test.js
      =====================================================================
      Script succeeded.
      Note: The line with the equal signs was truncated by me here in the email.

      Was the execution of the script really successful?

      I could not believe that as there should be displayed in the output window the file content read from active file and nothing else like the status information written by UltraEdit to the output window.

      I executed JavaScript Lint and could see in the output window:

      Code: Select all

      JavaScript Lint 0.3.0 (JavaScript-C 1.5 2004-09-24)
      Developed by Matthias Miller (http://www.JavaScriptLint.com)
      
      Test.js
      F:\Temp\Test.js(9): SyntaxError: missing ; before statement
         var sFileContent + UltraEdit.activeDocument.readText();
      ....................^
      
      
      1 error(s), 0 warning(s)
      Oh yes, that is absolutely right. The plus sign is wrong. It should be an equal sign.

      But why does the script execution with this serious syntax error result in a success message of the script execution by WebView2 although WebView2 did not run the script at all as in this case would have been cleared the output window?

      Conclusion: The information written by UltraEdit to the output window on execution of a script with WebView2 engine failed due to a syntax error is completely wrong and misleading.

      For verification I removed the comment line // @Engine=WebView2 and executed the script once again:

      The output window displayed:

      Code: Select all

      Scripting Engine: Using Spidermonkey
      Running script: F:\Temp\Test.js
      =====================================================================
      An error occurred on line 8:
           var sFileContent + UltraEdit.activeDocument.readText();
      Script failed.
      Yes, that is a correct script execution status information at the end with a useful information for a script developer on which line is a serious syntax error causing a completely failed script execution.

      UltraEdit should not output "Script succeeded." on script was not executed at all by the WebView2 engine.

      Syntax error during script execution on usage of WebView2 engine not reported by UltraEdit

      I am testing UltraEdit 2024.0.0.21 64-bit Beta 3 on Windows 11 23H2.

      I wrote the following small script:

      I removed the not working script as it is not important for this topic and I don't want non-working scripts posted in the forums.

      I executed this script on a copy of changes.txt in F:\Temp opened in UltraEdit 2024.0 Beta 3. Nothing changed on the file F:\Temp\changes.txt.

      I opened the output window and displayed was:

      Script succeeded.

      The status information written by UltraEdit to the output window on start of the script execution as well as the line with the information about the number of files are not visible in the output window. That means the script was executed at least until line 9. Then the script execution was most likely stopped by the WebView2 engine because of a syntax error.

      I wanted to run tests with the scripting commands (functions) readText and writeText although no description is available at the moment in help of UltraEdit 2024.0 Beta 3.

      It looks like my guess about the right usage of the functions readText and writeText was not successful.

      But there is output by UltraEdit the information "Script succeeded." in the output window although this is definitely not true. The script execution failed. It was started by the WebView2 engine, but did not finish successfully without any error.

      There should be displayed "Script failed." in the output window in this error case.
      I got first for both reports the reply that the issues could be reproduced by UltraEdit support and the developers were asked to investigate and correct them.

      I received some minutes later one more email with following information from an UltraEdit developer sent to UltraEdit support which forwarded it to me.
      UltraEdit developer/support wrote:You can create a ticket but I still have no idea how to get error information from WebView2 at this time and I have spent multiple days on it.
      Conclusion: UltraEdit 2024.0 cannot report back to the user of an UltraEdit script written for execution by the WebView2 engine if the script contains a serious syntax error resulting in WebView2 engine does not even start the script execution, or another syntax error like a typing mistake in a function name or calling a function with an invalid list of parameters which results in an exit of the script interpretation during the script execution by WebView2.

      That is of course not good for us who want to write UltraEdit/UEStudio scripts executed with modern WebView2 engine instead of old embedded version of SpiderMonkey engine. We can only run built-in JavaScript Lint to detect serious syntax errors before even running the script and must use UltraEdit.outputWindow.write("…") inside the script for debugging purposes on script does not run completely.

      If there is a programmer reading this with knowledge on how to get errors detected by WebView2 engine before or during script execution for showing it in own application, please contact UltraEdit support by email and share your knowledge with UltraEdit support/development. Thank you.
      Best regards from an UC/UE/UES for Windows user from Austria

      201
      Basic UserBasic User
      201

        18:56 - May 25#3

        Hello Mofi,

        Thank you for reporting this before.
        I thought I was the only one, as nothing has been posted about this yet.

        I'm already disappointed with UE: beautiful, convenient, easy to set up....
        But then a new engine is introduced that doesn't work reliably?
        Is there no testing?

        Sections of code from the web can't necessarily be easily translated back into the old version. This requires almost more knowledge of programming than writing everything from scratch.

        I mean, the support is great, but the developers??? That they don't even know how to go about it?

        And while we're at it: It must also be possible to convert the output of the error number in both versions, as Directory Opus has been able to do this for years and, as I said, their engine is over 20 years old!!! and is actually less suitable for programming.

        I remain hopeful and wait for the next or the next but one ... update 

        BTW: The JavaScript Lint on https://www.javascriptlint.com/ is it the same as here? The data there all looks much younger (approx. 3 years instead of 2004).
        But I wouldn't know what to do with them anyway, do they have to be compiled first?

        Greetings Frank
        (Translated with DeepL)
        Win10 Pro (64bit) 22H2 - UE 2024.0.0.28 64-bit

        6,654559
        Grand MasterGrand Master
        6,654559

          8:26 - May 26#4

          JavaScript Lint can be executed with active opened file being a JavaScript file or an UltraEdit/UEStudio script file by clicking
          • in ribbon mode on sixth tab Coding in fourth group Formatting on the fourth item JS/CSS and clicking in opened popup menu on last item JavaScript Lint or pressing on keyboard Alt+D and next twice J or
          • in toolbar/menu mode with contemporary menus on sixth menu Coding in the submenu JS/CSS on last item JavaScript Lint or pressing on keyboard Alt+D and next twice J or
          • in toolbar/menu mode with traditional menus on seventh menu Format in the submenu JS/CSS on last item JavaScript Lint or pressing on keyboard Alt+T and next twice J
          It is also possible opening Advanced - Settings or Configuration - Key mapping and assign to the command JavaScript Lint tool a hotkey or chord and run this tool with this hotkey or multi-key assignment.

          There is installed the configuration file tools\jsl\jsl.default.conf in program files folder of UltraEdit which is copied on first start of UltraEdit to %APPDATA%\IDMComp\UltraEdit\tools\jsl\jsl.default.conf by UltraEdit. That JavaScript Lint configuration file is configured at Advanced - Settings or Configuration - Integrated applications - JavaScript Lint as configuration file to use on running tools\jsl\jsl.exe in program files folder of UltraEdit. A user can make a copy of this configuration file, reference this copy in the configuration, and edit the configuration file for running JavaScript Lint with customized settings.

          The configuration file jsl.default.conf as well as the file GNU\src\source_code.txt in program files folder of UltraEdit reference https://www.javascriptlint.com as main home page of this tool. Well, there is missing in source_code.txt the character s after http as also in jsl.default.conf in the comment in third line and the downloads url is also not correct anymore. I will report these url issues to UltraEdit support for getting updated the urls in source_code.txt and also in jsl.default.conf in the subdirectories of the UltraEdit program files folder in a future version.

          Matthias Miller, author of JavaScript Lint, does not offer anymore a download of a Windows binary executable file. A user of UltraEdit for Windows or UEStudio must install Python with pip and follow the instructions in README in GitHub repository of JavaScript Lint for "compiling" (packing) the Python scripts into an executable which can be used either with a self-configured user tool or with replacing tools\jsl\jsl.exe in program files folder of UltraEdit for using the currently newest version 0.5.1 of JavaScript Lint if that is necessary for whatever reason (not for me up to now).
          Best regards from an UC/UE/UES for Windows user from Austria

          201
          Basic UserBasic User
          201

            Even more disadvantages with WebView2

            22:06 - May 28#5

            Frightening:

            Code: Select all

            //@Engine=WebView2
            
            const _ue         = UltraEdit;
            const _con        = _ue.outputWindow;
            const _thisDoc    = _ue.activeDocument;
            
            var intNumber = 0;
            
            intNumber = _thisDoc.currentLineNum;
            _con.write(typeof intNumber);
            
            = 'string' ????

            Code: Select all

            ////@Engine=WebView2
            
            const _ue         = UltraEdit;
            const _con        = _ue.outputWindow;
            const _thisDoc    = _ue.activeDocument;
            
            var intNumber = 0;
            
            intNumber = _thisDoc.currentLineNum;
            _con.write(typeof intNumber);
            = 'number'

            Greetings
            (Translated with DeepL)
            Win10 Pro (64bit) 22H2 - UE 2024.0.0.28 64-bit

            6,654559
            Grand MasterGrand Master
            6,654559

              UltraEdit document properties of type String instead of type Number

              5:17 - May 29#6

              It looks like German and Austrian people interpret things different than people from other countries. UltraEdit document properties are of type String on using the WebView2 engine which we expect of type Number as it is with SpiderMonkey engine. Here are two more emails which were send by me during the UltraEdit 2024.0 beta testing. There was changed nothing up to the public release of UltraEdit for Windows v2024.0.0.28.

              Number instead of string expected for some of the additional document properties

              I am testing 64-bit UltraEdit 2024.0.0.21 Beta 3 on Windows 11 23H2.

              I wrote this little script using the extended version of taglist.uet.

              Code: Select all

              // @Engine=WebView2
              var nNumber = 1;
              var nAverageLineLength = UltraEdit.activeDocument.averageLineLength;
              var nChangedLines = UltraEdit.activeDocument.changedLines;
              var nNonEmptyLines = UltraEdit.activeDocument.nonEmptyLines;
              var nSourceLines = UltraEdit.activeDocument.sLOC;
              var sDateAccessed = UltraEdit.activeDocument.dateAccessed;
              var sDateCreated = UltraEdit.activeDocument.dateCreated;
              var sDateModified = UltraEdit.activeDocument.dateModified;
              var sEnvironmentVariable = UltraEdit.getEnvironmentVariable("username");
              var sFileAttributes = UltraEdit.activeDocument.fileAttributes;
              var sFileOwner = UltraEdit.activeDocument.owner;
              var sLongestLine = UltraEdit.activeDocument.longestLine;
              var sSyntaxHighlighting = UltraEdit.activeDocument.syntaxHighlighting;
              
              UltraEdit.outputWindow.write("nNumber = " + nNumber.toString());
              UltraEdit.outputWindow.write("nNumber + 1 = " + (nNumber+1).toString());
              UltraEdit.outputWindow.write("nAverageLineLength = " + nAverageLineLength.toString());
              UltraEdit.outputWindow.write("nAverageLineLength + 1 = " + (nAverageLineLength+1).toString());
              UltraEdit.outputWindow.write("nChangedLines = " + nChangedLines.toString());
              UltraEdit.outputWindow.write("nChangedLines + 1 = " + (nChangedLines+1).toString());
              UltraEdit.outputWindow.write("nNonEmptyLines = " + nNonEmptyLines.toString());
              UltraEdit.outputWindow.write("nNonEmptyLines + 1 = " + (nNonEmptyLines+1).toString());
              UltraEdit.outputWindow.write("nSourceLines = " + nSourceLines.toString());
              UltraEdit.outputWindow.write("nSourceLines + 1 = " + (nSourceLines+1).toString());
              
              UltraEdit.outputWindow.write("sDateAccessed = " + sDateAccessed);
              UltraEdit.outputWindow.write("sDateCreated = " + sDateCreated);
              UltraEdit.outputWindow.write("sDateModified = " + sDateModified);
              UltraEdit.outputWindow.write("sEnvironmentVariable = " + sEnvironmentVariable);
              UltraEdit.outputWindow.write("sFileAttributes = " + sFileAttributes);
              UltraEdit.outputWindow.write("sFileOwner = " + sFileOwner);
              UltraEdit.outputWindow.write("sLongestLine = " + sLongestLine);
              UltraEdit.outputWindow.write("sSyntaxHighlighting = " + sSyntaxHighlighting);
              It can be seen that I expected the document properties averageLineLength, changedLines, nonEmptyLines and sLOC as being of type Number. But the text in the output window on running the script makes it clear that these properties are of type String because of +1 results in an append of "1" to the four variables instead of incrementing their values by one.

              I doubt that any UltraEdit script writer expects in future these properties as strings with the requirement using parseInt() for doing something with the values of these properties other than writing them into a file, the output window or a message box which would work in most cases also with numbers without using explicitly toString().

              Well, it can be documented that these four properties are of type String.

              I suggest nevertheless to change the type of the four new document properties averageLineLength, changedLines, nonEmptyLines and sLOC from String to Number.

              Better format for string value of scripting document property longestLine

              I am testing 64-bit UltraEdit 2024.0.0.17 Beta 2 on Windows 11 23H2 and Windows 7.

              I used in my UltraEdit Beta test script for the additional properties:

              Code: Select all

              UltraEdit.outputWindow.write("Longest line: " + UltraEdit.activeDocument.longestLine);
              The output with usage of WebView2 JS engine is:

              Code: Select all

              Longest line: 9(103 chars)
              The format of the string value of document property longestLine is not good for further processing it.

              Better would be

              Code: Select all

              9 / 103 chars
              instead of

              Code: Select all

              9(103 chars)
              as that would make it possible to use in the script:

              Code: Select all

              var asLongestLineData = UltraEdit.activeDocument.longestLine.split(" ");
              var nLongestLineNumber = parseInt(asLongestLineData[0],10);
              var nLongestLineChars = parseInt(asLongestLineData[2],10);
              There are more lines needed with not looking good "9(103 chars)" to get the line number of the longest line and the number of characters in the longest line as integer values.

              "9 / 103 chars" looks also better in my opinion.

              I suggest for that reason to change the string value of document property longestLine to format "line number / character number chars" if that is easy possible for the developers.
              Best regards from an UC/UE/UES for Windows user from Austria

              201
              Basic UserBasic User
              201

                11:14 - May 30#7

                Hi,

                messageBox only works for me under WebView2 ?

                Incidentally, I also sent an email to the support team the day before yesterday expressing my displeasure at the developers' strategy.
                You can't sell users a ‘final’ version in which the new engine has apparently not been integrated or not integrated properly without checking/testing.

                I'm still waiting for a response.... ⌛

                Greetings
                (Translated with DeepL)
                Win10 Pro (64bit) 22H2 - UE 2024.0.0.28 64-bit

                6,654559
                Grand MasterGrand Master
                6,654559

                  Issues with UltraEdit.messageBox in UltraEdit for Windows 2023.2 and 2024.0

                  8:56 - May 31#8

                  Here are my bug reports regarding to messageBox which I sent by email to UltraEdit support in December 2023 and in April 2024 and which were confirmed by the support.

                  It would be good that everybody encountering the same issues as reported by me reports them also be email to UltraEdit support. The more users report an issue the higher becomes the priority for fixing the issue.

                  Scripting command UltraEdit.messageBox does not open anymore a message box

                  The scripting command UltraEdit.messageBox does not open anymore a message box on execution of the script by 64-bit UltraEdit v2023.2.0.27 on 64-bit Windows 11 23H2 (OS Build 22631.2861) and by 32-bit UltraEdit v2023.2.0.27 on 64-bit Windows 7 SP1.

                  I created C:\Temp\Test.js with the following three lines:

                  Code: Select all

                  // @Engine=WebView2
                  UltraEdit.messageBox("Message text");
                  UltraEdit.messageBox("Message text","Message title");
                  I ran this script by clicking in toolbar/menu mode with traditional menus in menu Scripting on the menu item Run active script. I could not see any message box opened by UltraEdit. The output window shows a successful execution of the script by 64-bit UltraEdit v2023.2.0.27 on Windows 11 23H2.

                  I removed on Windows 7 the first comment line as the engine WebView2 is not available on Windows 7 at all. But the execution result is the same with usage of embedded Mozilla SpiderMonkey engine. There is no message box opened at all while the output window shows a successful execution of the script by 32-bit UltraEdit v2023.2.0.27 on Windows 7.

                  There is no problem with 32-bit UltraEdit 2023.1.0.23 on Windows 7 and I suppose also on Windows 11 (not tested as my archives are just on the Windows 7 PC). The two message boxes are displayed on execution.
                  UltraEdit support wrote:Thank you for your message and for pointing this out. I can reproduce what you've described here and will ask our developers to investigate and correct it.

                  Re: Scripting command UltraEdit.messageBox does not open anymore a message box

                  I detected by chance with 64-bit UltraEdit 2024.0.0.21 Beta 3 that the scripting command UltraEdit.messageBox works on specifying a window title string which can be also an empty string like "" and using the WebView2 engine.

                  In other words the following script with just two lines work:

                  Code: Select all

                  // @Engine=WebView2
                  UltraEdit.messageBox("Message text","Message title");
                  The script with the following three lines does not work:

                  Code: Select all

                  // @Engine=WebView2
                  UltraEdit.messageBox("Message text");
                  UltraEdit.messageBox("Message text","Message title");
                  The reason is a syntax error detected by the WebView2 engine because of omitting the "optional" message box title string causing an exit of the script execution without running the working second scripting command and a wrong information about success of script execution in output window.

                  Both scripting command lines do not work with 64-bit UltraEdit 2024.0.0.21 on removal of the comment line selecting WebView2 engine and running the script(s) with the SpiderMonkey JavaScript/WebAssembly engine.
                  UltraEdit support wrote:Thank you for your message. I have discussed this with our developers and have confirmed that the messageBox command is working correctly with the WebView2 engine. You would have to specify both elements (as shown in the first script) in order for this to work.
                  Best regards from an UC/UE/UES for Windows user from Austria