[quickjs-devel] Re: Method "Object.getOwnPropertyDescriptor" dose not meet ES standard

  • From: Fabrice Bellard <fabrice@xxxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Tue, 10 Sep 2019 11:04:21 +0200

Thank you for the bug report. It will be fixed in the next release.

Best regards,

Fabrice.

On 9/10/19 5:40 AM, Houyou Yao wrote:

Hello??
The following description is a possible issue for QuickJS:

*version:* quickjs-2019-08-18

*Testcase:*
var NISLFuzzingFunc = function() {
 ?0?2 ?0?2 var desc = Object.getOwnPropertyDescriptor("prop", "0");
 ?0?2 ?0?2 print(desc.value);
};
NISLFuzzingFunc();

*Command:*
./quickjs-2019-08-18/qjs testcase.js

*Output:*
TypeError: value has no property
 ?0?2 ?0?2 at NISLFuzzingFunc (testcase.js:3)
 ?0?2 ?0?2 at <eval> (testcase.js:5)

*Expected output:*
p

*Description:*
?0?2 ?0?2 According to ECMA-262 standard(from ECMAScript 2015 to ECMAScript Latest Draft), If the first argument of the function "Object.getOwnPropertyDescriptor" is not an object, its type should be converted to object, while QuickJS throws TypeError exception.
 ?0?2 ?0?2 The reference of ES standard is as follows:
https://tc39.es/ecma262/#sec-object.getownpropertydescriptor


Cheers,
Houyou Yao



Other related posts: