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

Symbol values should be accepted as a WeakMap key

    XMLWordPrintable

Details

    Description

      const map = new WeakMap();
      const sym = Symbol();
      map.set(sym, 42);
      

      This code is supposed to work in ES6, but it raises a TypeError instead.

      https://tc39.es/ecma262/multipage/keyed-collections.html#sec-weakmap-objects

      "WeakMaps are collections of key/value pairs where the keys are objects and/or symbols"

      Attachments

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

        Activity

          People

            diseraluca Luca Di Sera
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes