Closed Bug 572494 Opened 14 years ago Closed 14 years ago

removal of JSObjectOps::defaultValue

Categories

(Core :: JavaScript Engine, enhancement)

Other Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

See 572411 comment 0 and comment 3 for details.
Attached patch v1Splinter Review
The patch removes JSObjectOps::defaultValue and moves the logic behind the single custom implementation from xml_defaultProperty into xml_convert. The patch also fixes potentially problematic code in TraceRecorder::guardNativeConversion where for a non-native object a guard added only to check if JSObjectOps::defaultValue is default one without checking that JSClass::convert is a stub one.

Ideally it would be nice to allow for JSClass.convert to take a role of JSObjectOps::defaultValue. The idea is to make the JS_ConvertStub to call toString(), not valueOf("string") for a string convert hint so the switch over the convert hint in DefaultValue would be necessary only of JSClass::convert fails to produce a primitive value. But that is for another bug and for a discussion in the newsgroup.
Assignee: general → igor
Attachment #455214 - Flags: review?(jorendorff)
Comment on attachment 455214 [details] [diff] [review]
v1

Looks great.
Attachment #455214 - Flags: review?(jorendorff) → review+
(In reply to comment #1)
> Ideally it would be nice to allow for JSClass.convert to take a role of
> JSObjectOps::defaultValue. The idea is to make the JS_ConvertStub to call
> toString(), not valueOf("string") for a string convert hint so the switch over
> the convert hint in DefaultValue would be necessary only of JSClass::convert
> fails to produce a primitive value. But that is for another bug and for a
> discussion in the newsgroup.

This sounds great, but the newsgroups have been spammed and I may have missed your post. Also, bug on file yet?

/be
http://hg.mozilla.org/tracemonkey/rev/ab518f91a9bd
Whiteboard: fixed-in-tracemonkey
Blocks: 577840
http://hg.mozilla.org/mozilla-central/rev/ab518f91a9bd
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: