Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74087

"Maximum statement or expression depth exceeded" when using some 3rd party JavaScript libraries

    XMLWordPrintable

    Details

    • Commits:
      73231fe953145ac0df4e62f173e1a90076466012 (qt/qtdeclarative/5.12) eeb00570679c447f4701a92cd2e836f098724979 (qt/qtdeclarative/5.12) 426f3035a3753800ce340a83bdf8db13922f4cae (qt/qtdeclarative/dev)

      Description

      Starting with Qt 5.12.1, the JavaScript engine seems to be more restrictive, which makes using some existing 3rd party JavaScript libraries impossible. I've created a stripped down example to demonstrate this here: https://gist.github.com/mhoeher/1a7a5131031f40909283936107471cb9

       

      Basically, what I try to do is to use the 3rd party JavaScript library showdown.js to convert Markdown formatted text to HTML to display it within a QML application.

      For this, I have a wrapper JavaScript library which looks like this:

       

      Qt.include("showdown.js", function(status) {
          if (status.exception !== undefined) {
              console.warn("Failed to load showdown.js: ",
                           status.exception);
          }
      });
      
      function md2html(markdown) {
          var converter = new showdown.Converter();
          converter.setFlavor('github');
          return converter.makeHtml(markdown);
      }
      

      This worked fine up to Qt 5.12.0. However, starting with Qt 5.12.1, the library cannot be loaded anymore and on the console I get the following error message:

       

      qml: Failed to load showdown.js:  SyntaxError: Maximum statement or expression depth exceeded

      I am not sure if this new behaviour is intended, however, it makes using (some) 3rd party JavaScript libraries impossible

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            mhoeher Martin Höher
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes