Re: [w3c/IndexedDB] Key Paths: Support iteration step operator (#35)

What are the associated edge cases if we allowed the proposed syntax: `"a.b[].c"` ? What does the grammar look like? Is `"a[][]"` valid? (yes?) Is `"[]"` valid? (yes?) Is `"a[]a"` valid? (no?)

```
path := "" | (identifier | iteration) step*
step ::= "." identifier | iteration 
iteration ::= "[]"
identifier ::= IdentifierName /* [ECMA-262] */
```

Parsing then leads to a sequence of (identifier | iteration); https://w3c.github.io/IndexedDB/#dfn-evaluate-a-key-path-on-a-value would need to parse (not just split on "." then iterate), and if an iteration step is hit uses GetMethod(v, @@iterator) / GetIterator() like WebIDL and iterates/recurses, producing a key array.     


---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/35#issuecomment-215809228

Received on Friday, 29 April 2016 16:59:11 UTC