1. Let r be the result of running with value and keyPath. Rethrow any exceptions.

    2. If r is failure, return failure.

    3. Let key be the result of running convert a value to a key with r if the multiEntry flag is false, and the result of running with r otherwise. Rethrow any exceptions.

    4. If key is invalid, return invalid.

    5. Return key.

    To evaluate a key path on a value with value and keyPath, run the following steps. The result of these steps is an ECMAScript value or failure, or the steps may throw an exception.

    1. If keyPath is a list of strings, then:

      1. Let result be a new object created as if by the expression .

      2. Let i be 0.

      3. Return result.

        This will only ever “recurse” one level since key path sequences can’t ever be nested.

    2. Let identifiers be the result of keyPath on U+002E FULL STOP characters (.).

    3. For each identifier of identifiers, jump to the appropriate step below:

      If (value) is String, and identifier is “length

      Let value be a Number equal to the number of elements in value.

      If value is an Array and identifier is “length

      Let value be ToLength( Get(value, “length“)).

      If value is a [Blob](https://w3c.github.io/FileAPI/#dfn-Blob) and identifier is ““

      If value is a [Blob](https://w3c.github.io/FileAPI/#dfn-Blob) and identifier is “type

      Let value be a String equal to value’s [type](https://w3c.github.io/FileAPI/#dfn-type).

      If value is a and identifier is “name

      Let value be a String equal to value’s [name](https://w3c.github.io/FileAPI/#dfn-name).

      If value is a [File](https://w3c.github.io/FileAPI/#dfn-file) and identifier is “lastModified

      Let value be a Number equal to value’s .

      Otherwise

      1. If (value) is not Object, return failure.

      2. Let hop be ! (value, identifier).

      3. If hop is false, return failure.

      4. Let value be ! (value, identifier).

      5. If value is undefined, return failure.

    1. Assert: value is not an .

    Assertions can be made in the above steps because this algorithm is only applied to values that are the output of StructuredDeserialize and only access “own” properties.