Closed
Bug 748983
Opened 12 years ago
Closed 12 years ago
foo instanceof XMLHttpRequest always throws
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: regression)
Attachments
(2 files, 3 obsolete files)
13.66 KB,
patch
|
Details | Diff | Splinter Review | |
13.50 KB,
patch
|
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
We only generate a hasInstance hook in some cases. In the cases when we do NOT generate it, we should just be using a Function, not something of our interface object class. Otherwise hasInstance just throws.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #618459 -
Flags: review?(peterv)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #618500 -
Flags: review?(peterv)
Assignee | ||
Updated•12 years ago
|
Attachment #618459 -
Attachment is obsolete: true
Attachment #618459 -
Flags: review?(peterv)
Updated•12 years ago
|
Comment 3•12 years ago
|
||
Comment on attachment 618500 [details] [diff] [review]
With some asserts fixed
Review of attachment 618500 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/bindings/Utils.cpp
@@ +38,5 @@
> + }
> + constructor = JS_NewObject(cx, constructorClass, functionProto, global);
> + } else {
> + MOZ_ASSERT(constructorNative);
> + // XXXbz should the name for the function be "name" or NULL?
Can we clear this up? My gut says "name", but I don't see this defined anywhere.
@@ +108,5 @@
> ConstantSpec *constants, JSFunctionSpec *staticMethods,
> const char* name)
> {
> + MOZ_ASSERT(protoClass || constructorClass || constructor,
> + "Need at least one class!");
... or a constructor
@@ +263,5 @@
> +JSBool
> +ThrowingConstructorWorkers(JSContext* cx, unsigned argc, JS::Value* vp)
> +{
> + return Throw<false>(cx, NS_ERROR_FAILURE);
> +}
Could also templatize ThrowingConstructor.
::: dom/bindings/Utils.h
@@ +229,5 @@
> + * if it should be a function object.
> + * constructor is the JSNative to use as a constructor. If this is non-null, it
> + * should be used as a JSNative to back the interface object, which
> + * should be a Function. If this is null, then we should create an
> + * object of constructorClass, unles that's also null, in which case
unless
@@ +230,5 @@
> + * constructor is the JSNative to use as a constructor. If this is non-null, it
> + * should be used as a JSNative to back the interface object, which
> + * should be a Function. If this is null, then we should create an
> + * object of constructorClass, unles that's also null, in which case
> + * we shold not create an interface object at all.
should
Attachment #618500 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 4•12 years ago
|
||
> Can we clear this up? My gut says "name", but I don't see this defined anywhere.
Looks like .name on function is not actually standard. ;) I think having this come up as |function XMLHttpRequest() {}| makes a lot of sense. I'll just remove the XXX comment.
Fixed the other issues.
Assignee | ||
Updated•12 years ago
|
Whiteboard: [need review] → [need landing]
Assignee | ||
Comment 5•12 years ago
|
||
> Could also templatize ThrowingConstructor.
Can I put a pointer to a template function in the JSClass? Seems a bit chancy; I've left this part as is.
Assignee | ||
Comment 6•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #618500 -
Attachment is obsolete: true
Assignee | ||
Comment 7•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #620422 -
Attachment is obsolete: true
Assignee | ||
Comment 8•12 years ago
|
||
Flags: in-testsuite+
Whiteboard: [need landing]
Target Milestone: --- → mozilla15
Assignee | ||
Comment 9•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #620423 -
Attachment is obsolete: true
Assignee | ||
Comment 10•12 years ago
|
||
Comment on attachment 620587 [details] [diff] [review]
Aurora version of patch
[Approval Request Comment]
Regression caused by (bug #): bug 740069
User impact if declined: Incorrect instanceof behavior for XMLHttpRequest;
likely web content fallout.
Testing completed (on m-c, etc.): Passes automated tests
Risk to taking this patch (and alternatives if risky): Low risk: makes something
that throws right now return a boolen instead. Another option is disabling
the Paris bindings for XHR if we think this is too risky but don't want
to ship the bug. Yet another option is to ship the bug.
String changes made by this patch: None.
Attachment #620587 -
Flags: approval-mozilla-aurora?
Comment 11•12 years ago
|
||
Comment on attachment 620587 [details] [diff] [review]
Aurora version of patch
[Triage Comment]
Early enough in the cycle to take a low-risk fix for this regression. Approving for Aurora 14.
Attachment #620587 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Updated•12 years ago
|
Attachment #620423 -
Attachment is obsolete: false
Assignee | ||
Comment 12•12 years ago
|
||
status-firefox14:
--- → fixed
Comment 13•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•