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

Checking for UNDEFINED should not result "undefined error" thrown.

    XMLWordPrintable

Details

    Description

      Sorry I did not state the problem as clear as I should have. I guess I need to
      make it obvious. I thought I did that. But I was wrong. I will try make the title more obvious.
      This is NOT a SUGGESTION.

      If someone thinks checking to prevent an error, should throw an error, the purpose of "typeof"
      is not understood.

      =================================================================

      I did a test. I created a Qt Quick Prototype that contains a window.
      In the window I created an Item and an Component.onCompleted element.

      In the Item I created a function that passes an argument.
      In the function I test for the typeof value of a property that does exist
      but the qualified property of the argument does exist. The qualified property does not.
      ( see the two attached snapshots)

      If I do: typeof === "undefined", then it produces the correct result.
      However,
      If I do: typeof(x.z ) === "undefined", then if throws a bad reference error.

      I don't expect that the testing for existence of an undefined object or
      undefined property of an object should throw an error. The purpose was
      to detect the undefined element.

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            lawrence.emke Lawrence Emke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes