Closed Bug 783284 Opened 8 years ago Closed 8 years ago

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

Categories

(Toolkit :: OS.File, defect)

defect
Not set
normal

Tracking

()

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.
https://hg.mozilla.org/mozilla-central/rev/15cdfa85ed10
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.