duktape icon indicating copy to clipboard operation
duktape copied to clipboard

An issue about %TypedArray%.prototype.set

Open YaoHouyou opened this issue 3 years ago • 1 comments

Version

2.6.0

Overview

​ According to the ES6 , the parameter array in %TypedArray%.prototype.set (array [, offset]) is any ECMAScript language value other than an Object with a [[TypedArrayName]] internal slot. Therefore, it is legal when the parameter array is a string. However, duktape throws a TypeError when executing the following test case. So I think there may be a problem here.

Testcase

var NISLFuzzingFunc = function() {
	var e = '123';
	A = new Uint8Array(5);
	A.set(e);
	print(A);
};
NISLFuzzingFunc();

Actual Results

TypeError: object required, found '123'.

Expected Results

1,2,3,0,0

YaoHouyou avatar Mar 09 '21 04:03 YaoHouyou

Duktape doesn't attempt to be ES6 compatible yet, so there are many small deviances to ES6 you're likely to find you're fuzzing against ES6.

svaarala avatar Mar 09 '21 14:03 svaarala