archives

« Bugzilla Issues Index

#4288 — 12.3.3 Intl.DateTimeFormat.prototype.format: Missing ReturnIfAbrupt; .length not set for bound function


12.3.3 Intl.DateTimeFormat.prototype.format

[First algorithm]

Step 1: Missing ReturnIfAbrupt after `this DateTimeFormat object`.

Step 2: Remove colon after "then"

Step 2.a: Creating a separate section for the function is more ECMAScript2015-y (spec wise).

> Let F be a new built-in function object as defined in 12.3.3.1.

And the new 12.3.3.1 section would be:
---
12.3.3.1 DateTime Format Functions

A DateTime format function is an anonymous function that optionally takes an argument date. It performs the following steps:

1. Let dtf be the this value.
2. Assert: Type(dtf) is Object and dtf has an [[initializedDateTimeFormat]] internal slot whose value is true.
3. If date is not provided or is undefined, then
a. Let x be %Date_now%().
4. Else
b. Let x be ToNumber(date).
c. ReturnIfAbrupt(x).
5. Return FormatDateTime(dtf, x).
---

Step 2.a.iii: Remove "the result of"

Step 2.b: The bound function should have at least a .length property, maybe even a .name property.

Step 3: Duplicate full stop


[Second algorithm]

Step 1: Omit "then"
Step 3: Inline ECMAScript syntax not explained in "5 Notational Conventions".
Step 3: Change `).` to normal instead of bold font
Step 5: Change `).` to normal instead of bold font
Step 9.a: Remove colon after "then"
Step 9.a.iv: Omit "then"
Step 9.a.v: Omit "the"
Step 9.a.vi.2: Omit "the"
Step 9.a.vi.3: Omit "the"


> [First algorithm]

> Step 1: Missing ReturnIfAbrupt after `this DateTimeFormat object`.

Fixed.

> Step 2: Remove colon after "then"

Fixed.

> Step 2.a: Creating a separate section for the function is more ECMAScript2015-y (spec wise).

> Let F be a new built-in function object as defined in 12.3.3.1.

And the new 12.3.3.1 section would be:
---
12.3.3.1 DateTime Format Functions

A DateTime format function is an anonymous function that optionally takes an argument date. It performs the following steps:

1. Let dtf be the this value.
2. Assert: Type(dtf) is Object and dtf has an [[initializedDateTimeFormat]] internal slot whose value is true.
3. If date is not provided or is undefined, then
a. Let x be %Date_now%().
4. Else
b. Let x be ToNumber(date).
c. ReturnIfAbrupt(x).
5. Return FormatDateTime(dtf, x).
---


Added.



> Step 2.a.iii: Remove "the result of"
> Step 2.b: The bound function should have at least a .length property, maybe even a .name property.

length property added


> Step 3: Duplicate full stop

Fixed.


[Second algorithm]

> Step 1: Omit "then"

Fixed.

> Step 3: Inline ECMAScript syntax not explained in "5 Notational Conventions".

Yes, it's part of https://people.mozilla.org/~jorendorff/es6-draft.html#sec-list-and-record-specification-type


> Step 3: Change `).` to normal instead of bold font
> Step 5: Change `).` to normal instead of bold font
> Step 9.a: Remove colon after "then"
> Step 9.a.iv: Omit "then"
> Step 9.a.v: Omit "the"
> Step 9.a.vi.2: Omit "the"
> Step 9.a.vi.3: Omit "the"

Fixed.