Closed
Bug 643101
Opened 14 years ago
Closed 12 years ago
lookupProperty, deleteProperty, get/setAttributes, setProperty need to pass through the receiver object
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: gal, Assigned: gal)
References
Details
Attachments
(3 files, 3 obsolete files)
24.02 KB,
patch
|
Details | Diff | Splinter Review | |
57.17 KB,
patch
|
Details | Diff | Splinter Review | |
34.18 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
proxy traps want it, amongst others
Assignee | ||
Comment 1•14 years ago
|
||
Assignee: general → gal
Assignee | ||
Comment 2•14 years ago
|
||
This doesn't pipe receiver into Set/GetAttribute and Delete yet. The next patch will do that.
Assignee | ||
Comment 3•14 years ago
|
||
Comment on attachment 520419 [details] [diff] [review]
lookupProperty
Bounce to jorendorff if you are overloaded?
Attachment #520419 -
Flags: review?(brendan)
Assignee | ||
Updated•14 years ago
|
Summary: lookupProperty needs to pass through the receiver object → lookupProperty, deleteProperty, get/setAttributes, setProperty need to pass through the receiver object
Assignee | ||
Updated•14 years ago
|
Attachment #520419 -
Attachment description: patch → lookupProperty
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #520427 -
Flags: review?(brendan)
Assignee | ||
Comment 5•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #520428 -
Flags: review?(brendan)
Assignee | ||
Comment 6•14 years ago
|
||
Attachment #520429 -
Flags: review?(brendan)
Assignee | ||
Comment 7•14 years ago
|
||
I found at least 3 bugs reviewing the code (obj instead of obj2 used after FindProperty, with_getProperty didn't pass receiver through). Please look over my changes very carefully. I really don't like that we have the shortcut signature for lookupProperty without receiver. That hides bugs imo.
Assignee | ||
Comment 8•14 years ago
|
||
jorendorff, waldo, if either of you wants to steal this I am sure Brendan doesn't mind. This needs some very carefully looking and reasoning for every hunk.
Assignee | ||
Comment 9•14 years ago
|
||
Attachment #520419 -
Attachment is obsolete: true
Attachment #520419 -
Flags: review?(brendan)
Assignee | ||
Updated•14 years ago
|
Attachment #520430 -
Attachment is patch: true
Attachment #520430 -
Attachment mime type: application/octet-stream → text/plain
Attachment #520430 -
Flags: review?(brendan)
Assignee | ||
Updated•14 years ago
|
Attachment #520427 -
Attachment description: deleteProperty → deleteProperty (step 2)
Assignee | ||
Updated•14 years ago
|
Attachment #520428 -
Attachment description: get/setAttributes → get/setAttributes (step 3)
Assignee | ||
Updated•14 years ago
|
Attachment #520429 -
Attachment description: setProperty → setProperty (step 4)
Assignee | ||
Comment 10•14 years ago
|
||
I had to back off the change in FOR_GNAME (I picked up obj2 there instead of obj, but obj2 can be NULL). It should be the global obj either way. No need to mess with this I guess.
Attachment #520429 -
Attachment is obsolete: true
Attachment #520429 -
Flags: review?(brendan)
Attachment #520431 -
Flags: review?(brendan)
Assignee | ||
Updated•14 years ago
|
Attachment #520427 -
Attachment is obsolete: true
Attachment #520427 -
Flags: review?(brendan)
Assignee | ||
Updated•14 years ago
|
Attachment #520431 -
Flags: review?(brendan) → review?(jorendorff)
Assignee | ||
Updated•14 years ago
|
Attachment #520430 -
Flags: review?(brendan) → review?(jorendorff)
Assignee | ||
Updated•14 years ago
|
Attachment #520428 -
Flags: review?(brendan) → review?(jorendorff)
Comment 11•14 years ago
|
||
Um. What happened to part 2? Still wanted, right?
Assignee | ||
Comment 12•14 years ago
|
||
Jason, lets touch base real quick.
Comment 13•14 years ago
|
||
Comment on attachment 520431 [details] [diff] [review]
setProperty (part4)
part 4 first, naturally...
In jsfun.cpp, StrictArgSetter
> return js_DeleteProperty(cx, obj, obj, id, tvr.addr(), strict) &&
>- js_SetProperty(cx, obj, id, vp, strict);
>+ js_SetProperty(cx, obj, obj, id, vp, strict);
Micro-nit: The indentation was right before.
In jsobj.cpp:
> static JSBool
> with_GetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp)
> {
>- return obj->getProto()->getProperty(cx, id, vp);
>+ return obj->getProto()->getProperty(cx, receiver, id, vp);
> }
We don't ever want to pass the With object anywhere an actual *object*
is expected--With objects aren't even supposed to exist, right? So pass
obj->getProto() instead. If you want, this could even
JS_ASSERT(receiver == obj);
in both with_GetProperty and with_SetProperty. For that to fail, the
object would have to have already been exposed--a capital offense.
I can't get this to bite in a test, because we have defense in depth
against With objects escaping. But please do fix it.
In jsproxy.cpp:
> static JSBool
>-proxy_SetProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
>+proxy_SetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp, JSBool strict)
> {
> return JSProxy::set(cx, obj, obj, id, strict, vp);
> }
Huh. This looks wrong to me--should be (cx, obj, receiver...), right?
Again, I can't trip it up in the shell. Does this just never get called?
Attachment #520431 -
Flags: review?(jorendorff) → review+
Updated•14 years ago
|
Attachment #520430 -
Flags: review?(jorendorff)
Comment 14•14 years ago
|
||
Comment on attachment 520428 [details] [diff] [review]
get/setAttributes (step 3)
Clearing review flags for now (we don’t think the other patches are needed).
Attachment #520428 -
Flags: review?(jorendorff)
Comment 15•12 years ago
|
||
Marking this bug as invalid since it is not relevant with the direct proxies design.
Feel free to change the status if I'm mistaken.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•