Let r be the result of running with value and keyPath. Rethrow any exceptions.
If r is failure, return failure.
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.
If key is invalid, return invalid.
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.
If keyPath is a list of strings, then:
Let result be a new object created as if by the expression .
Let i be 0.
Return result.
This will only ever “recurse” one level since key path sequences can’t ever be nested.
Let identifiers be the result of keyPath on U+002E FULL STOP characters (.).
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
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.