Closed Bug 1036507 Opened 7 years ago Closed 7 years ago

JS::IdentifyStandard{Instance,Prototype} and friends are broken with respect to Error objects

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(3 files)

These things all just make use of JSCLASS_CACHED_PROTO_KEY, which doesn't work with Error subtypes that all share the same js::Class. I think we pretty much need a helper routine that handles Error instances explicitly by extracting the error type from the slot.
Attachment #8453282 - Flags: review?(jwalden+bmo)
This thing is basically only useful for ye olde JS_InitClass classes where
people might try to create objects with external JSClasses and expect various
defaults when they invoke JS_NewObject. Let's move it out of the way.
Attachment #8453283 - Flags: review?(jwalden+bmo)
Comment on attachment 8453282 [details] [diff] [review]
Part 1 - Remove some unused code. v1

Yoink.
Attachment #8453282 - Flags: review?(jwalden+bmo) → review+
Comment on attachment 8453283 [details] [diff] [review]
Part 2 - Remove deceptive GetClassProtoKey API. v1

Review of attachment 8453283 [details] [diff] [review]:
-----------------------------------------------------------------

Stealing at bholley's request.
Attachment #8453283 - Flags: review?(jwalden+bmo) → review+
Attachment #8453284 - Flags: review?(jwalden+bmo) → review+
You need to log in before you can comment on or make changes to this bug.