• Hixie's avatar
    Introduce an explicit Key type. · 74575775
    Hixie authored
    This fixes some theoretical bugs whereby we were using hashCode to try
    to get unique keys for objects, but really we wanted object identity.
    It also lays the groundwork for a new GlobalKey concept.
    
    I tried to keep the impact on the code minimal, which is why the "Key"
    constructor is actually a factory that returns a StringKey. The code
    has this class hierarchy:
    
    ```
       KeyBase
        |
       Key--------------+---------------+
        |               |               |
       StringKey    ObjectKey       UniqueKey
    ```
    
    ...where the constructors are Key and Key.stringify (StringKey),
    Key.fromObjectIdentity (ObjectKey), and Key.unique (UniqueKey).
    
    We could instead of factory methods use regular constructors with the
    following hierarchy:
    
    ```
       KeyBase
        |
       LocalKey---------+---------------+
        |               |               |
       Key      ObjectIdentityKey   UniqueKey
    ```
    
    ...with constructors Key, Key.stringify, ObjectIdentityKey, and
    UniqueKey, but I felt that that was maybe a more confusing hierarchy.
    I don't have a strong opinion on this.
    74575775
Name
Last commit
Last update
..
address_book/lib Loading commit data...
demo_launcher Loading commit data...
fitness Loading commit data...
game Loading commit data...
hello_world/lib Loading commit data...
mine_digger Loading commit data...
raw Loading commit data...
rendering Loading commit data...
stocks Loading commit data...
widgets Loading commit data...
BUILD.gn Loading commit data...
README.md Loading commit data...