| 19:23 | <jmdyck> | In https://tc39.es/ecma262/#sec-serializejsonproperty, step 11.b.i (from PR #3826) is "Assert: value is an Array. value is not a Proxy." This is odd for a couple reasons: (a) It's odd to have an Assert followed by two separate assertions. (Normally we'd connect them with "and" or make them to separate Asserts.) Note that esmeta is also confused by this construction. (b) Once you assert that value is an Array, then by definition it's not a Proxy. |
| 19:24 | <jmdyck> | (That step wasn't there when I reviewed the PR.) |
| 19:58 | <Richard Gibson> | it's from https://github.com/tc39/ecma262/pull/3826 , and I don't see a review from you there at all |
| 20:27 | <bakkot> | I also don't believe that assertion |
| 20:29 | <bakkot> | value starts out as an arbitrary ES value (just a Get on a user-supplied object, or the return of a user-supplied toJSON or reviver), and none of the subsequent narrowings rule out a Proxy |
| 20:46 | <Richard Gibson> | yeah, good point. That assertion fails for e.g. JSON.stringify(new Proxy([], {})) |
| 21:26 | <jmdyck> | I ran it through ecmaspeak, but didn't have any comments. |
| 22:02 | <ljharb> | isn't a proxy for an array also an array? meaning you'd need both assertions to rule out a proxied array |
| 22:03 | <jmdyck> | a proxy for an array satisfies "IsArray", but it doesn't satisfy "is an Array" |