Closed
Bug 390948
Opened 19 years ago
Closed 19 years ago
js1_5/Regress/regress-156354.js FAIL browser - NS_ERROR_ILLEGAL_VALUE
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: bc, Assigned: mrbkap)
References
()
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
|
2.20 KB,
patch
|
jst
:
approval1.9+
|
Details | Diff | Splinter Review |
The following tests regressed in the browser between 8/2-8/3
js1_5/Regress/regress-156354.js
js1_5/extensions/regress-381205.js
js1_5/extensions/regress-383965.js
js1_5/extensions/scope-001.js
Flags: in-testsuite+
| Assignee | ||
Comment 1•19 years ago
|
||
This fixes a typo in GetWrapper (duh!) that fixes most of the testcase. The rest of the fix is in XPCWrapper::NewResolve, where we now preserve getter, setter and attributes (such as JSPROP_ENUMERATE).
Johnny, does this do the right thing for safe JSObject wrappers, where we used to only set ENUMERATE?
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #276224 -
Flags: superreview?(jst)
Attachment #276224 -
Flags: review?(jst)
Comment 2•19 years ago
|
||
Comment on attachment 276224 [details] [diff] [review]
Proposed fix
GetWrapper(JSContext *cx, JSObject *obj)
{
while (JS_GET_CLASS(cx, obj) != &sXPC_XOW_JSClass.base) {
- obj = JS_GetParent(cx, obj);
+ obj = JS_GetPrototype(cx, obj);
if (!obj) {
break;
}
Um, yeah :)
- In XPCWrapper::NewResolve():
+ uintN attrs = sprop->attrs;
+ JSPropertyOp getter = (attrs & JSPROP_GETTER) ? sprop->getter : nsnull;
+ JSPropertyOp setter = (attrs & JSPROP_SETTER) ? sprop->setter : nsnull;
OBJ_DROP_PROPERTY(cx, innerObjp, prop);
@@ -310,8 +314,8 @@ XPCWrapper::NewResolve(JSContext *cx, JS
return JS_FALSE;
}
- JSBool ok = OBJ_DEFINE_PROPERTY(cx, wrapperObj, interned_id, v, nsnull,
- nsnull, JSPROP_ENUMERATE, nsnull);
+ JSBool ok = OBJ_DEFINE_PROPERTY(cx, wrapperObj, interned_id, v, getter,
+ setter, attrs, nsnull);
Do we know we don't need to wrap getter/setter in XOWs or anything here?
r+sr=jst with that.
Attachment #276224 -
Flags: superreview?(jst)
Attachment #276224 -
Flags: superreview+
Attachment #276224 -
Flags: review?(jst)
Attachment #276224 -
Flags: review+
| Assignee | ||
Comment 3•19 years ago
|
||
(In reply to comment #2)
> Do we know we don't need to wrap getter/setter in XOWs or anything here?
In the interests of paranoia, I'm going to punt on this for now, and just pass (attrs & JSPROP_ENUMERATE) with no getter or setter.
| Assignee | ||
Comment 4•19 years ago
|
||
Attachment #276224 -
Attachment is obsolete: true
| Assignee | ||
Updated•19 years ago
|
Attachment #276530 -
Flags: approval1.9?
Updated•19 years ago
|
Attachment #276530 -
Flags: approval1.9? → approval1.9+
| Assignee | ||
Comment 5•19 years ago
|
||
Fix checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 6•19 years ago
|
||
(In reply to comment #0)
> The following tests regressed in the browser between 8/2-8/3
>
> js1_5/Regress/regress-156354.js
This passes in the trunk now.
> js1_5/extensions/regress-381205.js
> js1_5/extensions/regress-383965.js
> js1_5/extensions/scope-001.js
>
These still fail in the trunk however with different errors.
BUGNUMBER: 381205
STATUS: uneval with special getter functions
FAILED! expected: invalid getter usage
BUGNUMBER: 383965
STATUS: getter function with toSource
FAILED! expected: gett has no properties
BUGNUMBER: 53268
STATUS: Testing scope after changing obj.__proto__
PASSED! Step 1: setting obj.__proto__ = global object
FAILED! expected: [reported from test()] Expected value '5', Actual value '1'
FAILED! expected: [reported from test()] Type mismatch, expected type undefined, actual type number Expected value 'undefined', Actual value '1'
PASSED! Step 2: setting obj.__proto__ = null
PASSED! Step 3: setting obj.__proto__ to global object again
PASSED! Step 3: setting obj.__proto__ to global object again
PASSED! Step 4: setting obj.__proto__ to null again
PASSED! Step 4: setting obj.__proto__ to null again
It difficult to diagnose the cause since there might have been another causes in the meantime hidden by the this bug. Should I reopen this bug or file new ones?
| Reporter | ||
Comment 7•19 years ago
|
||
verified fixed 1.9.0 linux/mac*/windows
Status: RESOLVED → VERIFIED
| Reporter | ||
Comment 8•19 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•