ChakraCore
ChakraCore copied to clipboard
Jitted code doesn't throw ArrayBuffer detached exception
Jitted code for setting an element to a typed array checks if the length is greater than 0. If not, it just bypasses the set. We set the length of the typed array to 0 if its array buffer was detached, so bypassing the set if the length is 0 prevents us from writing to detached buffer, but it also means that we won't throw the "Array buffer detached" exception.