Closed Bug 637207 Opened 13 years ago Closed 13 years ago

"name" and "message" enumerable on *Error.prototype

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: erights, Assigned: heycam)

References

Details

Attachments

(2 files)

For all so-called NativeError.prototype objects, their "name" and "message" properties are enumerable when they shouldn't be.

I am classifying this as minor since an initialization script can easily repair this using Object.defineProperty.
js> for (i in Error.prototype) print(i)
name
message
fileName
lineNumber
exn_enumerate() looks really weird and unnecessary. Sounds like we can easily fix this for FF5.
Missed when fixing bug 574867.

/be
I'll try this.
Assignee: general → cam
Status: NEW → ASSIGNED
Attached patch patchSplinter Review
Attachment #525801 - Flags: review?(gal)
Attachment #525801 - Flags: review?(gal) → review+
Looks like it landed: http://hg.mozilla.org/mozilla-central/rev/9743d95d473e
Target Milestone: --- → mozilla6
Version: unspecified → Trunk
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
The removed function ("exn_enumerate") is still declared at the top of jsexn.cpp (but never defined or used), which triggers:
../../../mozilla/js/src/jsexn.cpp:83: warning: ‘JSBool exn_enumerate(JSContext*, JSObject*)’ declared ‘static’ but never defined

The attached trivial followup should fix this.
Attachment #526415 - Flags: review?(gal)
Comment on attachment 526415 [details] [diff] [review]
followup to remove declaration of removed function

Thanks.
Attachment #526415 - Flags: review?(gal) → review+
Depends on: 681896
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: