jerryscript icon indicating copy to clipboard operation
jerryscript copied to clipboard

A question about Uint8Array operation

Open YiWen-y opened this issue 3 years ago • 0 comments

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.

YiWen-y avatar May 14 '22 08:05 YiWen-y