TypedArray constructor should not use iterator for typed arrays
Reported by
zloir...@gmail.com,
Nov 17 2015
|
||||||
Issue description``` var a = new Uint8Array([1, 2, 3, 4]); a[Symbol.iterator] = _ => [4, 3, 2, 1][Symbol.iterator](); new Uint8Array(a); // => [4, 3, 2, 1], should be [1, 2, 3, 4] ``` http://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%-object http://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%-typedarray
,
Nov 18 2015
,
Nov 18 2015
,
Feb 24 2016
This should definitely be addressed, but I'm worried about the web compat implications. These are being discussed upstream at https://github.com/tc39/ecma262/issues/265 but they have not been brought to discussion in TC39 committee time. I think we can make some improvements without risking compat, but it will be tricky to figure out what exactly to do and what not to do.
,
Feb 24 2016
core.js rolled back part of this change due to compat issues: https://github.com/karma-runner/karma/issues/1768
,
Feb 24 2016
FF already has a correct length validation here + it can be fixed on NodeJS side only for Buffer, so I don't think it can be reverted from the spec.
,
Mar 23 2017
,
Dec 19 2017
Did this get resolved on the spec side? |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by zloir...@gmail.com
, Nov 17 2015