Open NWU-NISL opened 4 years ago
MDN has almost the same example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
Yes, that should be a TypeError
I've had a quick dig here - the spec sets out a specific way of doing this that would throw with an typed array BUT the CC implementation is different - and doesn't have the ability to throw. To fix this could either implement the actual method per spec OR special case it to throw for non-empty typedarrays/dataviews.
When I performed a freeze operation on an initialized TypedArray, ChakraCore did not report an error, but other engines, such as SpiderMonkey and JavascriptCore, all reported errors.So I think there may be something wrong here.
version
chakra-1_11_22
command
testcase
Output
Expected behavior
Contributor : @Haobin-Lee