jerryscript-project / jerryscript

Ultra-lightweight JavaScript engine for the Internet of Things.
https://jerryscript.net
Apache License 2.0
6.88k stars 666 forks source link

Inconsistent behavior #5077

Open Georgezxh opened 1 year ago

Georgezxh commented 1 year ago

Description

Other js engines can print correctly while jerry throws a type error.

JerryScript revision

2.4.0

Build platform

ubuntu20.04

Test case

result = String.prototype.normalize.call(String.prototype.padStart.call(0, 5, '-'));
print(result);

Output

Unhandled exception: TypeError

Expected behavior

----0

matetokodi commented 1 year ago

Currently String.prototype.normalize is not implemented because it would require the use of libICU or a similar library for proper unicode and locale support, which would increase the size of the jerryscript binary substantially, and as such it will not be done.

zherczeg commented 12 months ago

Adding an icu would increase the library size too much.