But this is an implementation detail, not specified behavior. Changing method behavior in subclasses is a key aspect of inheritance.
But this is an implementation detail, not specified behavior. Changing method behavior in subclasses is a key aspect of inheritance.
Changing method behavior in subclasses is part of inheritance, but it shouldn't confuse or mislead. In the case of Buffer and Uint8Array, the altered `.slice()` functionality isn't a mere implementation detail; it's a significant deviation. This inconsistency can lead to unexpected bugs, especially for those who assume similar behavior based on the inheritance hierarchy. It's crucial for reliability that such fundamental behaviors remain predictable across subclasses.
[0] https://tc39.es/ecma262/multipage/indexed-collections.html#s...
Correct spec: https://tc39.es/ecma262/multipage/indexed-collections.html#s...
Steps 14.g.i to 14.g.ix detail the transfer of data from the original TypedArray (O) to the new TypedArray (A). It involves reading values from the original and writing them to the new array's buffer, effectively duplicating the data segment. The process ensures both arrays are distinct with separate memory spaces.