Closed Bug 783284 Opened 12 years ago Closed 12 years ago

Rename {winLastCreation, winLastWrite, winLastAccess}Time -> Date

Categories

(Toolkit Graveyard :: OS.File, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla17

People

(Reporter: Yoric, Assigned: Yoric)

Details

Attachments

(1 file, 1 obsolete file)

For uniformity, we should rename winLastCreationTime et al to winLastCreationDate.
Attached patch Renaming *Time to *Date (obsolete) — Splinter Review
Assignee: nobody → dteller
Attachment #652458 - Flags: review?(nfroyd)
Comment on attachment 652458 [details] [diff] [review]
Renaming *Time to *Date

Review of attachment 652458 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/osfile/osfile_win_front.jsm
@@ +611,3 @@
>           let date = FILETIME_to_Date(this._ftCreationTime);
> +         delete this.winCreationDate;
> +         Object.defineProperty(this, "winCreationDate", {value: date});

For my own edification, why are we doing this delete/defineProperty dance?  This doesn't appear to buy anything save garbage generation, and some quick Googling doesn't turn up this pattern.  I thought the whole point of getters was that you could compute things dynamically.
Attachment #652458 - Flags: review?(nfroyd) → review+
(In reply to David Rajchenbach Teller [:Yoric] from comment #3)
> Does the following reply to your question?
> https://bug766194.bugzilla.mozilla.org/attachment.cgi?id=641495

Oh my.  That's...awful.  I see the idiom now, but...*whistles*.
In js-ctypes based stuff, I have started using this idiom everywhere, because calling a C function from JS is expensive, non-JIT-able, and also requires some gc-ing.
Attachment #652458 - Attachment is obsolete: true
Attachment #652775 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/15cdfa85ed10
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: