jerryscript-project / jerryscript

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

A question about Uint8Array operation #5007

Closed YiWen-y closed 1 year ago

YiWen-y commented 2 years ago
Version

Version: 3.0.0 (fea10bb7)

Test case
var foo = function () {
    let view = new Uint8Array([1,2,3]);
    view[''] = 0;
    print(view);
}
foo();
Execution steps
/.jsvu/jerry Testcase.js
Output
0,2,3
Expected behavior
1,2,3
Description

The correct output of the test case should be 1,2,3 while jerryscript yields 0,2,3. we simply change the Uint8Array view by view[''] = 0,which shouldn't have any impact on view, but jerryscript abnormally replace the first element of view with 0 ,I think it might be an issue of jerryscript.

AidPaike commented 1 year ago

This bug has been silently fixed in the latest version of JerrySctript.