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

CreateDataProperty is sometimes called with ? but can't throw #703

Open
jyasskin opened this Issue Sep 29, 2016 · 8 comments

Comments

Projects
None yet
4 participants
@jyasskin

jyasskin commented Sep 29, 2016

https://tc39.github.io/ecma262/#sec-internalizejsonproperty, https://tc39.github.io/ecma262/#sec-createdatapropertyorthrow, and a few other places use "? CreateDataProperty(...)", but its definition appears to use just true and false return values to say whether it has succeeded.

This is related to #253.

@shvaikalesh

This comment has been minimized.

Show comment
Hide comment
@shvaikalesh

shvaikalesh Sep 29, 2016

Contributor

O may be an exotic Proxy object with defineProperty trap that throws or breaks invariants. Please, see [[DefineOwnProperty]].

Contributor

shvaikalesh commented Sep 29, 2016

O may be an exotic Proxy object with defineProperty trap that throws or breaks invariants. Please, see [[DefineOwnProperty]].

@jyasskin

This comment has been minimized.

Show comment
Hide comment
@jyasskin

jyasskin Sep 29, 2016

In that case, the far more common use of CreateDataProperty() without either ! or ? should be fixed.

jyasskin commented Sep 29, 2016

In that case, the far more common use of CreateDataProperty() without either ! or ? should be fixed.

@shvaikalesh

This comment has been minimized.

Show comment
Hide comment
@shvaikalesh

shvaikalesh Sep 29, 2016

Contributor

I have checked all (49) usages of CreateDataProperty and there are no calls without ! or ? that may receive Proxy as first argument.

Contributor

shvaikalesh commented Sep 29, 2016

I have checked all (49) usages of CreateDataProperty and there are no calls without ! or ? that may receive Proxy as first argument.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Sep 29, 2016

Member

@shvaikalesh any user-provided object, including "this" values, could be a Proxy.

Member

ljharb commented Sep 29, 2016

@shvaikalesh any user-provided object, including "this" values, could be a Proxy.

@shvaikalesh

This comment has been minimized.

Show comment
Hide comment
@shvaikalesh

shvaikalesh Sep 29, 2016

Contributor

All ! / ?-less calls operate on objects created in the same abstract operation or method, mostly arrays or plain objects. They do not get any user-passed stuff.

Contributor

shvaikalesh commented Sep 29, 2016

All ! / ?-less calls operate on objects created in the same abstract operation or method, mostly arrays or plain objects. They do not get any user-passed stuff.

@shvaikalesh

This comment has been minimized.

Show comment
Hide comment
@shvaikalesh

shvaikalesh Sep 29, 2016

Contributor

may receive Proxy as first argument.

sorry for the confusion, I meant first argument of CreateDataProperty

Contributor

shvaikalesh commented Sep 29, 2016

may receive Proxy as first argument.

sorry for the confusion, I meant first argument of CreateDataProperty

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Sep 29, 2016

Member

Does the HTML spec use that abstract operation at all?

Member

ljharb commented Sep 29, 2016

Does the HTML spec use that abstract operation at all?

@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Sep 30, 2016

Contributor

@ljharb it does at the end of https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclone preceded by ?. Although I think in HTML's case it cannot really be called on a proxy so maybe that is wrong?

Contributor

annevk commented Sep 30, 2016

@ljharb it does at the end of https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclone preceded by ?. Although I think in HTML's case it cannot really be called on a proxy so maybe that is wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment