Skip to content

new features about Number.prototype.toLocaleString() for IE11, a lot of related new definitions#67

Merged
fasttime merged 26 commits into
fasttime:mainfrom
Clayblockunova:main
May 31, 2026
Merged

new features about Number.prototype.toLocaleString() for IE11, a lot of related new definitions#67
fasttime merged 26 commits into
fasttime: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

Clayblockunova commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

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 thread test/helpers/feature-emulation.helpers.js Outdated
Comment thread test/helpers/feature-emulation.helpers.js Outdated
@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 Outdated
Comment thread src/lib/definitions.js Outdated
Comment thread src/lib/features.js Outdated
Comment thread src/lib/features.js Outdated
@Clayblockunova

Copy link
Copy Markdown
Contributor Author

seems remarks generation need a fix?

@fasttime

Copy link
Copy Markdown
Owner

seems remarks generation need a fix?

Yes, I will take a look.

@fasttime

Copy link
Copy Markdown
Owner

Okay, the remarks should be fixed now.

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

can this be combined now?

@fasttime fasttime left a comment

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.

Sorry, this is a big PR and it may take some time for me to review all the changes. I've added some more comments.

Comment thread src/lib/features.js Outdated
Comment thread src/lib/features.js Outdated
Comment thread src/lib/features.js Outdated
Comment thread src/lib/features.js Outdated
Comment thread src/lib/features.js Outdated
@Clayblockunova

Copy link
Copy Markdown
Contributor Author

anything else to do?

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

seems generation of ‎Features.md also need fix?

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

seems generation of ‎Features.md also need fix?

can I fix that? or should I leave it to you?

@fasttime fasttime left a comment

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.

Thanks! The descriptions in Features.md should be fixed now. I also left some questions on the PR.

Comment thread src/lib/features.js Outdated
checkLocaleNumeral('cs', NaN, /^.....č/) &&
checkLocaleNumeral('el', Infinity, /^Άπε..ο/) &&
checkLocaleNumeral('el', NaN, /^μη.αριθ.ός/) &&
checkLocaleNumeral('he', NaN, /^ל/) &&

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.

Is there a reason why only the first letter is used in definitions?

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.

cuz only definition of the first letter practical in IE11 (there is no ITERATOR_HELPER in IE 11).

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.

Actually, it's okay to add definitions for feature combinations that aren't available in supported engines. Engines keep adding and removing features all the time, so some of those definitions may actually become useful at some point.

Comment thread src/lib/features.js Outdated
checkLocaleNumeral('ja', Infinity, /^.∞/) &&
checkLocaleNumeral('ja', NaN, /^.....非数値/) &&
checkLocaleNumeral('lt', Infinity, /^.......ė/) &&
checkLocaleNumeral('pl', Infinity, /^.............ś/) &&

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.

It seems that ń and ć could be also defined from this string.

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.

again, impractical in IE11.

Comment thread src/lib/features.js
Comment on lines +355 to +356
checkLocaleNumeral('zh', Infinity, /^正/) &&
checkLocaleNumeral('zh-cn', NaN, /^..字/);

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.

Similarly for 'zh' and zh-cn, maybe more characters could be defined?

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.

again, only definitions of "正" and "字" are practical. btw, "非" and "数" are overlapped with 'ja' case.

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.

Oh, true. I hadn't noticed that some characters already have a definition.

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

anyway, how can I test whether a definition work under arbitrary feature set (including ones impossible in major environment?)

@fasttime

Copy link
Copy Markdown
Owner

anyway, how can I test whether a definition work under arbitrary feature set (including ones impossible in major environment?)

You need to use emuEval from feature-emulation.helpers. It's not included in the npm package, so you have to copy it from the repo. For example:

const JScrewIt = require('jscrewit');
require('./feature-emulation.helpers.js');

const definition = '([].at.constructor + [])[10]';
const features = ['AT', 'IE_SRC'];

const { replacement } = JScrewIt.debug.createEncoder(features).resolve(definition);
const value = emuEval(features, replacement);
console.log(value); // "F"

This works also inside browsers if you use <script> tags instead of require.

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

and, how can I filter overperformed definition automatically? can node dev/char-index.mjs do that?

@fasttime

fasttime commented May 22, 2026

Copy link
Copy Markdown
Owner

and, how can I filter overperformed definition automatically? can node dev/char-index.mjs do that?

node dev/char-index.mjs list :overdefined: will only tell you if any characters have unnecessary definitions. You can check .jscrewit.char-map.json to see which definitions are used and which not. Note that the characters must be added first (with node dev/char-index.mjs add <chars>).

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

seems "zh" cases is considered as overperformed by node dev/char-index.mjs. should we modify the function useLocaleNumeralDefinition()?

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

can optimize: true be used in define._callWithFeatures()?

@Clayblockunova

Clayblockunova commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

I tried to add optimize: true in useLocaleNumeralDefinition(), and that works.

@Clayblockunova

Copy link
Copy Markdown
Contributor Author

can this be merged now?

@fasttime fasttime changed the title New Features about Number.prototype.toLocaleString() for IE11 in win7 and 8, a lot of related new definitions (Final PR) new features about Number.prototype.toLocaleString() for IE11, a lot of related new definitions May 31, 2026
@fasttime fasttime merged commit fcb5f90 into fasttime:main May 31, 2026
20 checks passed
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