Add JS_NewDateObject, JS_NewDateObjectMsec, JS_ObjectIsDate to the JSAPI

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: andrew, Unassigned)

Tracking

({dev-doc-complete})

2.0 Branch
Points:
---

Firefox Tracking Flags

(status2.0 ?)

Details

(Whiteboard: [fixed-in-tracemonkey])

Attachments

(1 attachment)

Reporter

Description

9 years ago
In our embedding code, we need to create JS Date objects and determine if objects are dates. We do this right now by using the underlying non-public methods. I'd like to get these added to the public API so we are not poking inside the engine for them.
Attachment #503949 - Flags: review?(jorendorff)
Attachment #503949 - Flags: approval2.0?
Comment on attachment 503949 [details] [diff] [review]
Patch to add functions to jsapi.h/jsapi.cpp

Looks great to me. I think it's well worth taking, even this close to the release, because it's a community contribution and can't introduce bugs in our stuff, because we won't be calling the new functions.
Attachment #503949 - Flags: review?(jorendorff) → review+
We should take this.

/be
status2.0: --- → ?
Comment on attachment 503949 [details] [diff] [review]
Patch to add functions to jsapi.h/jsapi.cpp

Agree, land away.
Attachment #503949 - Flags: approval2.0? → approval2.0+
Thanks, ap!

http://hg.mozilla.org/tracemonkey/rev/27bf86dbdb52

(Rats, I forgot to put the bug number in the commit message. Shouldn't be too awful for anyone, I hope.)
Summary: Add JS_NewDateObject/JS_NewDateObjectMsec/JS_ObjectIsDate to JSAPI → Add JS_NewDateObject, JS_NewDateObjectMsec, JS_ObjectIsDate to the JSAPI
Whiteboard: [fixed-in-tracemonkey]
Backed out due to a silly mistake (JS_NewDateObject has two parameters named m):

  https://hg.mozilla.org/tracemonkey/rev/75354982793c

I've fixed that locally and I'll re-push later today.
Whiteboard: [fixed-in-tracemonkey]
Take 2: https://hg.mozilla.org/tracemonkey/rev/54a8ab97c419
Whiteboard: [fixed-in-tracemonkey]
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Version: Trunk → 2.0 Branch
evilpie documented these; I tidied them up and added them to the list on the JSAPI Reference page.
You need to log in before you can comment on or make changes to this bug.