mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Specified diagnostic for iterating known array type without --downlevelIteration (#40070)
* Specified error message for iterating known array types without --downlevelIteration * Added extra target info to diagnostic * NodeList too, a classic * PR feedback: invert to allowsStrings; required param Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
33
tests/cases/compiler/typedArrays-es5.ts
Normal file
33
tests/cases/compiler/typedArrays-es5.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
// @target: ES5
|
||||
|
||||
const float32Array = new Float32Array(1);
|
||||
[...float32Array];
|
||||
|
||||
const float64Array = new Float64Array(1);
|
||||
[...float64Array];
|
||||
|
||||
const int16Array = new Int16Array(1);
|
||||
[...int16Array];
|
||||
|
||||
const int32Array = new Int32Array(1);
|
||||
[...int32Array];
|
||||
|
||||
const int8Array = new Int8Array(1);
|
||||
[...int8Array];
|
||||
|
||||
const nodeList = new NodeList();
|
||||
[...nodeList];
|
||||
|
||||
const uint16Array = new Uint16Array(1);
|
||||
[...uint16Array];
|
||||
|
||||
const uint32Array = new Uint32Array(1);
|
||||
[...uint32Array];
|
||||
|
||||
const uint8Array = new Uint8Array(1);
|
||||
[...uint8Array];
|
||||
|
||||
const uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
[...uint8ClampedArray];
|
||||
|
||||
|
||||
31
tests/cases/compiler/typedArrays-es6.ts
Normal file
31
tests/cases/compiler/typedArrays-es6.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// @target: ES6
|
||||
|
||||
const float32Array = new Float32Array(1);
|
||||
[...float32Array];
|
||||
|
||||
const float64Array = new Float64Array(1);
|
||||
[...float64Array];
|
||||
|
||||
const int16Array = new Int16Array(1);
|
||||
[...int16Array];
|
||||
|
||||
const int32Array = new Int32Array(1);
|
||||
[...int32Array];
|
||||
|
||||
const int8Array = new Int8Array(1);
|
||||
[...int8Array];
|
||||
|
||||
const nodeList = new NodeList();
|
||||
[...nodeList];
|
||||
|
||||
const uint16Array = new Uint16Array(1);
|
||||
[...uint16Array];
|
||||
|
||||
const uint32Array = new Uint32Array(1);
|
||||
[...uint32Array];
|
||||
|
||||
const uint8Array = new Uint8Array(1);
|
||||
[...uint8Array];
|
||||
|
||||
const uint8ClampedArray = new Uint8ClampedArray(1);
|
||||
[...uint8ClampedArray];
|
||||
Reference in New Issue
Block a user