Closed Bug 552999 Opened 16 years ago Closed 16 years ago

PointerType.prototype.isNull

Categories

(Core :: js-ctypes, defect, P1)

Other Branch
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jdm)

Details

Attachments

(1 file, 1 obsolete file)

<jorendorff> dwitte: what's the easiest way to find out if the value of a pointer CData object is null? <dwitte> ctypes.cast(obj, ctypes.uintptr_t).value.toString() == "0" <dwitte> we should probably do .isNull() :)
P1, need this for 1.9.3. Trivial API addition and should be quite useful for devs.
Priority: -- → P1
Attached patch isNull implementation + tests (obsolete) — Splinter Review
Here you go.
Assignee: nobody → josh
Attachment #435453 - Flags: review?(dwitte)
Comment on attachment 435453 [details] [diff] [review] isNull implementation + tests Looks good, but I think we want isNull() to be a function, not a property. You'll need to add an sPointerInstanceFunctions, and then add that to the appropriate bits through the code. Should be trivial. (Don't forget to add isNull() to the type ctor tests at http://mxr.mozilla.org/mozilla-central/source/js/ctypes/tests/unit/test_jsctypes.js.in#1570.)
All comments addressed.
Attachment #435453 - Attachment is obsolete: true
Attachment #435500 - Flags: review?(dwitte)
Attachment #435453 - Flags: review?(dwitte)
Comment on attachment 435500 [details] [diff] [review] isNull implementation + tests v1.1 Cool beans!
Attachment #435500 - Flags: review?(dwitte) → review+
Keywords: checkin-needed
In my queue for checkin.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: