Closed
Bug 574867
Opened 15 years ago
Closed 15 years ago
<NativeError>.prototype.message properties should be own, not simply visible to users because they're on Error.prototype
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla2.0b1
People
(Reporter: Waldo, Assigned: Waldo)
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
3.42 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
The MS ES5 test suite checks for this, ES5 is clear enough about what should happen.
Attachment #454174 -
Flags: review?(lw)
![]() |
||
Updated•15 years ago
|
Attachment #454174 -
Flags: review?(lw) → review+
Comment 1•15 years ago
|
||
Comment on attachment 454174 [details] [diff] [review]
Patch
> /* Make the prototype for the current constructor name. */
>- proto = NewObject(cx, &js_ErrorClass,
>- (i != JSEXN_ERR) ? error_proto : obj_proto,
>- obj);
>+ JSObject *proto = NewObject(cx, &js_ErrorClass,
>+ (i != JSEXN_ERR) ? error_proto : obj_proto, obj);
Declaring at first assignment is great, thanks for that -- but prevailing style favors keeping that final obj arg on its own line. Once an overlong argument has forced a line break, the shorties get their own lines (they can share if adjacent, maybe; judgment call). The above loses the final arg in an expression that's long enough the comma hides.
Good fix, this is way old code, from 1998 or 1999. Did ES3 differ?
/be
Attachment #454174 -
Flags: review+ → review?(lw)
Updated•15 years ago
|
Attachment #454174 -
Flags: review?(lw) → review+
Assignee | ||
Comment 2•15 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/a8211f428f21
ES3 said the same.
Even better here seems to move the whole expression down a line and indent it, then there's no need for a visually-disruptive line break at all.
Whiteboard: fixed-in-tracemonkey
Comment 3•15 years ago
|
||
(In reply to comment #2)
> http://hg.mozilla.org/tracemonkey/rev/a8211f428f21
>
> ES3 said the same.
That slacker mccabe :-P.
> Even better here seems to move the whole expression down a line and indent it,
> then there's no need for a visually-disruptive line break at all.
Not bad -- better sometimes, but over-complicates args can merit their own lines even if all would fit on one line with little else. Nice patch anyway, in the end; thanks.
/be
Comment 4•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•