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

Warn about shadowing JS objects

    XMLWordPrintable

Details

    Description

      When doing something stupid in a large code base, it takes some time to i.e. realize why

       

      String.fromCharCode(...)

       

      is undefined / does not work as expected. The attached example boils it down to the problem: someone created a String.qml which is imported with the Module and overrides the global JS object. Fun fact is that this worked before for whatever reason.

      It would be nice to see some warning on runtime here.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes