Skip to content

New Features about Number.prototype.toLocaleString() for IE11 in win7 and 8, a lot of related new definitions (Final PR)#67

Open
Clayblockunova wants to merge 15 commits intofasttime:mainfrom
Clayblockunova:main
Open

New Features about Number.prototype.toLocaleString() for IE11 in win7 and 8, a lot of related new definitions (Final PR)#67
Clayblockunova wants to merge 15 commits intofasttime:mainfrom
Clayblockunova:main

Conversation

@Clayblockunova
Copy link
Copy Markdown
Contributor

I've finally made all these local Infinity and NaN stuff building normally. Is there anything else to do for us?

@Clayblockunova
Copy link
Copy Markdown
Contributor Author

Clayblockunova commented Mar 10, 2026

when will this be merged? should I wait for cleaning up work finished?

@fasttime
Copy link
Copy Markdown
Owner

Hi! I'm in the process of preparing version 3. I'd suggest holding off on any code cleanup until that's done. Once the new version is ready, I'll take care of this PR.

@Clayblockunova
Copy link
Copy Markdown
Contributor Author

how does this PR work with current build?

Comment thread src/lib/features.js Outdated
Comment on lines +375 to +382
description:
'Localized number formatting exclusive to Interner Explorer 11 in Windows 8.\n' +
'In this case, Latvian and Russian string representation of Infinity are both "∞".',
check:
function ()
{
var available = Infinity.toLocaleString('lv') === '∞' &&
Infinity.toLocaleString('ru') === '∞';
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Latvian is not used in definitions with this feature, it's fine to leave it out. We could mention only Russian.

Another thing I noticed is that this feature is supported in all modern browsers, so the name and the description don't seem to fit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just repurposed that into RUSSIAN_INFINITY for modern browsers usage.

Comment on lines +907 to +915
case 'lv':
switch (+this) // In Internet Explorer 9, +this is different from this.
{
case Infinity:
return '∞';
case -Infinity:
return '-∞';
}
break;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this isn't needed

Suggested change
case 'lv':
switch (+this) // In Internet Explorer 9, +this is different from this.
{
case Infinity:
return '∞';
case -Infinity:
return '-∞';
}
break;

switch (locale)
{
case 'lv':
switch (+this) // In Internet Explorer 9, +this is different from this.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internet Explorer 9 is no longer supported, so it's fine to use just this instead of +this.

Suggested change
switch (+this) // In Internet Explorer 9, +this is different from this.
switch (this)

Same for the other occurrences in this file.

@Clayblockunova
Copy link
Copy Markdown
Contributor Author

can we merge this now?

@fasttime
Copy link
Copy Markdown
Owner

I've merged the parts with RUSSIAN_INFINITY and IE_11_WIN_8. I'll review the other changed when I find some time.

@fasttime fasttime force-pushed the main branch 2 times, most recently from 39a28a2 to d37266a Compare April 16, 2026 20:56
Comment thread src/lib/definitions.js
Comment on lines -656 to +660
[
define('(RP_5_A + atob("NaNfalse"))[10]'),
],
'\x1e': '(RP_5_A + atob("NaNfalse"))[10]',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The array indicates the definition is non-static, i.e. it can expand differently depending on the selected feature set. For example, currently:

console.log('DEFAULT', JScrewIt.encode('"\x1e"').length);
console.log('CHROME', JScrewIt.encode('"\x1e"', { features: "CHROME" }).length);

prints:

DEFAULT 3605
CHROME 851

but with this PR applied it would become:

DEFAULT 3605
CHROME 3605

So we can't replace 1-element definition arrays with strings. I've added checks to prevent accidental changes like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants