jerryscript-project / jerryscript

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

A problem in String length #5055

Open Georgezxh opened 1 year ago

Georgezxh commented 1 year ago

JerryScript revision

2.4.0

Build platform

ubuntu 20.04

Description

When I run the Test case , I find that jerryscript has no output. But if I set the loop number smaller than 174296, it can output correctly. Is it because that the number has reached to the maximum allowed String length in jerryscript? I wonder why the jerry outputs nothing.

Test case

var a = 'A'; var b = 'B'; for (var i = 0; i < 174296; i++) { a = a + b; } print(a.length);

Output

Expected behavior

174297