mozIStorageFunction should be a [function]

RESOLVED FIXED in mozilla1.9.2b1

Status

()

Toolkit
Storage
--
trivial
RESOLVED FIXED
10 years ago
8 years ago

People

(Reporter: Mook, Assigned: Akshay Gupta)

Tracking

({dev-doc-complete, verified1.9.1})

Trunk
mozilla1.9.2b1
dev-doc-complete, verified1.9.1
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(status1.9.1 .4-fixed)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
mozIStorageFunction is, as its name states, a (callback) function; it has exactly one method and no attributes, and its sole purpose in life is to be a callback.

It should be tagged as [function] to be easier to use from JS.  There's seriously no point it not being one.

Updated

9 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [good first bug]
(Assignee)

Comment 1

8 years ago
Created attachment 391591 [details] [diff] [review]
|function| added
[Checkin: Comment 3 & 13]
Attachment #391591 - Flags: review?(sdwilsh)
Assignee: nobody → kitallis
Comment on attachment 391591 [details] [diff] [review]
|function| added
[Checkin: Comment 3 & 13]

r=sdwilsh
Attachment #391591 - Flags: review?(sdwilsh) → review+

Updated

8 years ago
Keywords: checkin-needed
Comment on attachment 391591 [details] [diff] [review]
|function| added
[Checkin: Comment 3 & 13]


http://hg.mozilla.org/mozilla-central/rev/0dd522c0975c

"approval1.9.1.3=?":
Trivial, 0 risk.
Attachment #391591 - Attachment description: |function| added. → |function| added [Checkin: Comment 3]
Attachment #391591 - Flags: approval1.9.1.3?
Severity: enhancement → trivial
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Keywords: checkin-needed
Hardware: x86 → All
Resolution: --- → FIXED
Whiteboard: [good first bug]
Target Milestone: --- → mozilla1.9.2b1
Does the uuid need to be changed for this? If so, and maybe even if not, this isn't a trivial patch and can't be accepted on branch unless another interface is created, which probably isn't worth it...
Keywords: dev-doc-needed
Comment on attachment 391591 [details] [diff] [review]
|function| added
[Checkin: Comment 3 & 13]

Approved for 1.9.1.4, a=dveditz for release-drivers
Attachment #391591 - Flags: approval1.9.1.3? → approval1.9.1.4+

Updated

8 years ago
Keywords: checkin-needed
(In reply to comment #4)

> Does the uuid need to be changed for this? If so, and maybe even if not, this

To be explicit, this patch does _not_ change the uuid.

> isn't a trivial patch and can't be accepted on branch unless another interface
> is created, which probably isn't worth it...

Shawn, what about that? (I'm confused.)
Flags: in-testsuite-
Someone said on irc that the uuid doesn't need to be changed - it's only looked at by xpconnect and it doesn't impact native code callers (who care about the uuid).

This patch is fine as is (hence the r+).
To be explicit, I was asking for a confirmation that the patch was good for m-1.9.1...
Whiteboard: [c-n: m-1.9.2]
Whiteboard: [c-n: m-1.9.2] → [c-n: m-1.9.1]
How does this affect usage? Want to be sure I get this change properly documented. At immediate glance, it doesn't look like there's really much to do other than update the most recently updated version number in the doc.
(Reporter)

Comment 10

8 years ago
(In reply to comment #9)
> How does this affect usage?
In the example on the mozIStorageFunction page, it can now be written as:

dbConn.createFunction("square", 1, function(aArguments) let (value = aArguments.getInt32(0)) value * value );

You can now pass in a function directly, instead of an object with a onFunctionCall property; this is similar to how DOM event listeners can be functions, and not objects with a handleEvent property.
Thanks for the tip; now I understand what this means. I suspected that's what it was but needed to be sure, obviously.

Updated the doc here with a second, revised, sample; would appreciate it if someone could confirm that it looks right:

https://developer.mozilla.org/en/mozIStorageFunction
Keywords: dev-doc-needed → dev-doc-complete
Tweaked the code sample slightly to be a little more clear.
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/3a325b21cbce
status1.9.1: --- → .4-fixed
Keywords: checkin-needed
Whiteboard: [c-n: m-1.9.1]
Attachment #391591 - Attachment description: |function| added [Checkin: Comment 3] → |function| added [Checkin: Comment 3 & 13]
Verified checked into 1.9.1 for 1.9.1.4 by looking at source.
Keywords: verified1.9.1
You need to log in before you can comment on or make changes to this bug.