-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async function: silent swallowing of the "override mistake" #322
Comments
And that it violates the principle of least surprise. No one who doesn't already know about this expects things to act that way. Even those who do know often find themselves surprised. And that its actual behavior has not found a single use case for which it is useful |
Looks like an XS bug to me. Is there a Moddable bug we can link to? Attn @phoddie |
er... this is a Moddable bug, no? i.e. an issue raised against moddable xs. |
Doh! I didn't realize what repository I was reading. |
@erights not that this is exactly the appropriate venue for this discussion, but I seem to recall back in the 2015s that there were some security concerns WRT overriding frozen properties. Is that not the case at all? |
The only security issue that comes to mind is exactly the override mistake. By making assignment fail here, you deter people from freezing objects when they should. That's exactly what happened, resulting in a world that's vastly less secure than it would have been otherwise. I doubt we ever examined an option of preventing override of inherited properties, even by |
The body of async functions executed in sloppy mode. Oops... |
Hi,
The "override mistake" is an EcmaScript spec decision that an own property cannot override a frozen property in its prototype chain. It's a mistake according to @erights because it's a specification that prevents a reasonable use case.
However, given that decision, I would expect the following module code to throw a
TypeError
:When running as in import from an XS Compartment, I get output:
I would expect the
async
case to throw a similarTypeError
. At least it partially implements the override mistake. However, I think this silent failure is a nonconformance, as all module code is supposed to be strict.When I run it with
node t.js
, I get:Refs Agoric/agoric-sdk#401
The text was updated successfully, but these errors were encountered: