Closed Bug 491646 Opened 15 years ago Closed 15 years ago

Expose js_StrictlyEqual() to consumers

Categories

(Core :: JavaScript Engine, enhancement)

x86
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: donny.viszneki, Assigned: jorendorff)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20081130 Minefield/3.1b3pre
Build Identifier: 

It would be nice for applications embedding Spidermonkey to have linker access to js_StrictlyEqual() :)

Reproducible: Always
Attached patch patch! (obsolete) — Splinter Review
i disagree with the request (JS_FRIEND_API), but only because it's the wrong fix.

either a JS_StrictlyEquals should be created or a JS_SomethingEquals should be which provides a flag arg that enables access to js_StrictlyEquals.

Note that js shell uses js_StrictlyEquals which means that today you can't build js shell against js lib (I had a patch which let me build js shell against the library a while ago, clearly it doesn't anymore as I haven't provided that method).
Summary: make js_StrictlyEqual() JS_FRIEND_API → Expose js_StrictlyEqual() to consumers
Let's make a public API. Cc'ing folks one of whom should take this bug. Thanks,

/be
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: wanted1.9.2?
Forgot to thank Donny for the bug and patch -- thanks!

/be
Attached patch a real patch (obsolete) — Splinter Review
Until there is a proper API, it would be nice for this patch to be applied :)
Attachment #377007 - Flags: review?(mrbkap)
Comment on attachment 377007 [details] [diff] [review]
a real patch

This just adds JS_FRIEND_API to js_StrictlyEqual()
Attached patch v1Splinter Review
Well, we might as well make it official in that case.

This API depends on === being infallible. If desired I could change the signature to,

  JSBool JS_StrictlyEqual(JSContext *cs, jsval v1, jsval v2, JSBool *result);

with the return value indicating success or failure, rather than === or !==.  It's nice to think that === will be infallible forever, but who knows?  Operator overloading in ES Harmony?
Assignee: general → jorendorff
Attachment #375951 - Attachment is obsolete: true
Attachment #377007 - Attachment is obsolete: true
Attachment #377682 - Flags: review?(mrbkap)
Attachment #377007 - Flags: review?(mrbkap)
=== and !== are infallible, this is important. Although past operator proposals have included these among the operators that could be defined by user types, I'm skeptical anything like those proposals will fly in Harmony.

We should keep the signature infallible and bet on this. If we lose, API change!

/be
Attachment #377682 - Flags: review?(mrbkap) → review+
http://hg.mozilla.org/tracemonkey/rev/2e1bbcf8a13e
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/2e1bbcf8a13e
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: wanted1.9.2? → wanted1.9.2+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: