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

[REG 5.11.2->5.12.0] QJSEngine: implicit creation of a variable with the name of the key in a function of an object

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11
    • Commits:
      3e716029ae61bf4c7bb33643ac331156e70e34f1 (qt/qtdeclarative/5.12)

      Description

      QJSEngine e;
      
      e.evaluate("\
      o= {\
        a:() => { const a = 42; return a; }\
      }").toString()
      // "SyntaxError: Identifier a has already been declared" rather than "42"
      
      e.evaluate("\
      const a = 42; \
      const o = {\
        a: () => { return a; } \
      }; \
      o.a()").toString()
      // "function a() { [native code] }" rather than "42"
      
      e.evaluate("\
      const a = 42; \
      const f = () => { return a; }; \
      o = {a:f}; \
      o.a()").toString()
      // "42"
      

        Attachments

        For Gerrit Dashboard: QTBUG-75880
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              ulherman Ulf Hermann
              Reporter:
              jpo Jonathan Poelen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes