Last Comment Bug 637207 - "name" and "message" enumerable on *Error.prototype
: "name" and "message" enumerable on *Error.prototype
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla6
Assigned To: Cameron McCormack (:heycam)
:
Mentors:
Depends on: 650646 681896
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-27 13:54 PST by Mark S. Miller
Modified: 2011-08-25 02:53 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (7.88 KB, patch)
2011-04-13 14:13 PDT, Cameron McCormack (:heycam)
gal: review+
Details | Diff | Splinter Review
followup to remove declaration of removed function (635 bytes, patch)
2011-04-15 16:06 PDT, Daniel Holbert [:dholbert]
gal: review+
Details | Diff | Splinter Review

Description Mark S. Miller 2011-02-27 13:54:42 PST
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.
Comment 1 Andreas Gal :gal 2011-02-27 14:02:08 PST
js> for (i in Error.prototype) print(i)
name
message
fileName
lineNumber
Comment 2 Andreas Gal :gal 2011-02-27 14:08:17 PST
exn_enumerate() looks really weird and unnecessary. Sounds like we can easily fix this for FF5.
Comment 3 Brendan Eich [:brendan] 2011-02-27 15:16:30 PST
Missed when fixing bug 574867.

/be
Comment 4 Mark S. Miller 2011-02-27 19:56:05 PST
http://code.google.com/p/v8/issues/detail?id=1215
Comment 5 Mark S. Miller 2011-02-27 20:32:12 PST
https://bugs.webkit.org/show_bug.cgi?id=55347
Comment 6 Cameron McCormack (:heycam) 2011-04-11 22:02:18 PDT
I'll try this.
Comment 7 Cameron McCormack (:heycam) 2011-04-13 14:13:53 PDT
Created attachment 525801 [details] [diff] [review]
patch
Comment 8 Nickolay_Ponomarev 2011-04-14 11:08:01 PDT
Looks like it landed: http://hg.mozilla.org/mozilla-central/rev/9743d95d473e
Comment 9 Daniel Holbert [:dholbert] 2011-04-15 16:06:45 PDT
Created attachment 526415 [details] [diff] [review]
followup to remove declaration of removed function

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.
Comment 10 Andreas Gal :gal 2011-04-15 16:19:05 PDT
Comment on attachment 526415 [details] [diff] [review]
followup to remove declaration of removed function

Thanks.
Comment 11 Daniel Holbert [:dholbert] 2011-04-18 12:34:05 PDT
Landed followup: http://hg.mozilla.org/mozilla-central/rev/19f14915646a

Note You need to log in before you can comment on or make changes to this bug.