Closed
Bug 306617
Opened 20 years ago
Closed 20 years ago
The generic function dispatcher should imitate Function.call
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mrbkap, Assigned: mrbkap)
Details
(Keywords: fixed1.8, js1.5)
Attachments
(1 file)
|
8.64 KB,
patch
|
brendan
:
review+
shaver
:
superreview+
brendan
:
approval1.8b4+
|
Details | Diff | Splinter Review |
Problems with the latest checkin.
-- null shouldn't throw.
-- this may be miscomputed.
Shaver's patch would have done better, except that we still wouldn't have the
desired compatibility. Patch in a minute.
| Assignee | ||
Comment 1•20 years ago
|
||
Use ComputeThis for total compatibility and safety!
Attachment #194470 -
Flags: superreview?(shaver)
Attachment #194470 -
Flags: review?(brendan)
Comment 2•20 years ago
|
||
Comment on attachment 194470 [details] [diff] [review]
Use ComputeThis.
>+ /*
>+ * Follow Function.prototype.apply and .call by using the global object as
>+ * the 'this' param if no args.Match Function.protype.call.
>+ */
Random garbage at the end of the comment?
Gotta run, but I'll review for real when I get back.
Comment 3•20 years ago
|
||
Comment on attachment 194470 [details] [diff] [review]
Use ComputeThis.
>+ /*
>+ * We know that argv[0] is valid because JS_DefineFunctions, which is our
>+ * only (indirect) referrer, defined us as requiring at least one argument
>+ * (notice how it passes fs->nargs + 1 as the next-to-last argument to
>+ * JS_DefineFunction).
>+ */
>+ if (JSVAL_IS_PRIMITIVE(argv[0])) {
> /*
> * Make sure that this is an object, as required by the generic
> * functions.
s/an object/& or null/
>+
>+ /*
>+ * Follow Function.prototype.apply and .call by using the global object as
>+ * the 'this' param if no args.Match Function.protype.call.
Trailing junk starting at "Match".
Thanks for fixing this, shaver and I owe you.
/be
Attachment #194470 -
Flags: review?(brendan) → review+
Comment 4•20 years ago
|
||
Comment on attachment 194470 [details] [diff] [review]
Use ComputeThis.
sr+thanks=shaver
Attachment #194470 -
Flags: superreview?(shaver) → superreview+
Updated•20 years ago
|
Attachment #194470 -
Flags: approval1.8b4+
| Assignee | ||
Comment 6•20 years ago
|
||
Fix checked into MOZILLA_1_8_BRANCH and trunk.
Updated•20 years ago
|
Flags: testcase-
You need to log in
before you can comment on or make changes to this bug.
Description
•