Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCreateDataProperty is sometimes called with ? but can't throw #703
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shvaikalesh
Sep 29, 2016
Contributor
O may be an exotic Proxy object with defineProperty trap that throws or breaks invariants. Please, see [[DefineOwnProperty]].
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
I have checked all (49) usages of |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Sep 29, 2016
Member
@shvaikalesh any user-provided object, including "this" values, could be a Proxy.
|
@shvaikalesh any user-provided object, including "this" values, could be a Proxy. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
All |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shvaikalesh
Sep 29, 2016
Contributor
may receive Proxy as first argument.
sorry for the confusion, I meant first argument of CreateDataProperty
sorry for the confusion, I meant first argument of |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Does the HTML spec use that abstract operation at all? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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?
|
@ljharb it does at the end of https://html.spec.whatwg.org/multipage/infrastructure.html#structuredclone preceded by |
jyasskin commentedSep 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
trueandfalsereturn values to say whether it has succeeded.This is related to #253.