HasPropertyWhichCouldRunUserCode
I have a larger concern about how this AO assumes a lot abuot the object that is passed to it, without actually requiring anything from its callers.
- Is this AO meant to be safe to call without triggering user code, or is it expected that it could run user code in order to tell if a future access would run user code? (I assume the answer is "yes"?)
- The note says that that AO relies on the fact that ordinary [[GetPrototypeOf]] never runs user code, but the AO itself does not check that the object is an ordinary object.
I think we should also add a check along the lines of:
- If o's [[GetPrototypeOf]] is not one of the internal [[GetPrototypeOf]] methods defined in sections 1.a.i, 3.c.ii, ..., then
- If o's [[GetPrototypeOf]] is not defined by this specification, return a host-defined Boolean.
- Return true.
And similar for [[GetOwnProperty]], if we rely on that being side-effect free. For example, the [[GetOwnProperty]] as extended by https://tc39.es/proposal-defer-import-eval/ can run user code.
That list might get hard to maintain, so we might also decide to instead mark whether a [[GetPrototypeOf]]/[[GetOwnProperty]] internal method can trigger side effects or not in the method definition itself. I'm curious to hear what the other @tc39/ecma262-editors think about this.
RequiresDeferredPromiseResolution
PerformPromiseResolution
CreateResolvingFunctions
SafePromiseResolve
HasPropertyWhichCouldRunUserCode
PropertyAccessCouldRunUserCodeI have a larger concern about how this AO assumes a lot abuot the object that is passed to it, without actually requiring anything from its callers.
I think we should also add a check along the lines of:
And similar for [[GetOwnProperty]], if we rely on that being side-effect free. For example, the [[GetOwnProperty]] as extended by https://tc39.es/proposal-defer-import-eval/ can run user code.
That list might get hard to maintain, so we might also decide to instead mark whether a [[GetPrototypeOf]]/[[GetOwnProperty]] internal method can trigger side effects or not in the method definition itself. I'm curious to hear what the other @tc39/ecma262-editors think about this.
RequiresDeferredPromiseResolution
PerformPromiseResolution
CreateResolvingFunctions
PerformPromiseResolutionwith?. You need to handle its completion and properly reject the promise, as the oldCreateResolvingFunctionsdoes.SafePromiseResolve
<emu-note type="editor">for notes that are just meant as editorial comments about the proposal itself and not to actually be considered as part of the spec text.