Expose js_StrictlyEqual() to consumers

RESOLVED FIXED

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Donny Viszneki, Assigned: jorendorff)

Tracking

unspecified
x86
Linux
Points:
---
Bug Flags:
wanted1.9.2 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

9 years ago
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
(Reporter)

Comment 1

9 years ago
Created attachment 375951 [details] [diff] [review]
patch!

Comment 2

9 years ago
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
(Reporter)

Comment 5

9 years ago
Created attachment 377007 [details] [diff] [review]
a real patch

Until there is a proper API, it would be nice for this patch to be applied :)
(Reporter)

Updated

9 years ago
Attachment #377007 - Flags: review?(mrbkap)
(Reporter)

Comment 6

9 years ago
Comment on attachment 377007 [details] [diff] [review]
a real patch

This just adds JS_FRIEND_API to js_StrictlyEqual()
(Assignee)

Comment 7

9 years ago
Created attachment 377682 [details] [diff] [review]
v1

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

Updated

9 years ago
Attachment #377682 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 9

9 years ago
http://hg.mozilla.org/tracemonkey/rev/2e1bbcf8a13e
Whiteboard: fixed-in-tracemonkey

Comment 10

9 years ago
http://hg.mozilla.org/mozilla-central/rev/2e1bbcf8a13e
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Flags: wanted1.9.2? → wanted1.9.2+
You need to log in before you can comment on or make changes to this bug.