Title: Update `TypedArray` constructors to disallow invalid `(typedArray, byteOffset, byteLength)` · Issue #44191 · microsoft/TypeScript · GitHub
Open Graph Title: Update `TypedArray` constructors to disallow invalid `(typedArray, byteOffset, byteLength)` · Issue #44191 · microsoft/TypeScript
X Title: Update `TypedArray` constructors to disallow invalid `(typedArray, byteOffset, byteLength)` · Issue #44191 · microsoft/TypeScript
Description: lib Update Request Configuration Check My compilation target is ES2020 and my lib is the default. Missing / Incorrect Definition TypedArray constructors allows passing (TypedArray, byteOffset, byteLength), when only byteOffset and byteLe...
Open Graph Description: lib Update Request Configuration Check My compilation target is ES2020 and my lib is the default. Missing / Incorrect Definition TypedArray constructors allows passing (TypedArray, byteOffset, byte...
X Description: lib Update Request Configuration Check My compilation target is ES2020 and my lib is the default. Missing / Incorrect Definition TypedArray constructors allows passing (TypedArray, byteOffset, byte...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/44191
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update `TypedArray` constructors to disallow invalid `(typedArray, byteOffset, byteLength)`","articleBody":"# lib Update Request\r\n\r\n## Configuration Check\r\n\r\nMy compilation *target* is `ES2020` and my *lib* is `the default`.\r\n\r\n## Missing / Incorrect Definition\r\n\r\n`TypedArray` constructors allows passing `(TypedArray, byteOffset, byteLength)`, when only `byteOffset` and `byteLength` are only used when passing in an `ArrayBuffer`\r\n\r\n## Sample Code\r\n\r\n```ts\r\nconst buf = new ArrayBuffer(1024);\r\nconst uint8 = new Uint8Array(buf, 16, 128)\r\n// No TS error, even though the `16` and `32` are completely ignored\r\nconst subUint8 = new Uint8Array(uint8, 16, 32)\r\nsubUint8.byteLength // Oops, this is 128, not 32.\r\n```\r\n\r\n## Documentation Link\r\n\r\n[MDN on `Uint8Array` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array#syntax)\r\n```ts\r\nnew Uint8Array(); // new in ES2017\r\nnew Uint8Array(length);\r\nnew Uint8Array(typedArray);\r\nnew Uint8Array(object);\r\n\r\nnew Uint8Array(buffer);\r\nnew Uint8Array(buffer, byteOffset);\r\nnew Uint8Array(buffer, byteOffset, length);\r\n```\r\n","author":{"url":"https://github.com/tjjfvi","@type":"Person","name":"tjjfvi"},"datePublished":"2021-05-20T22:24:43Z","url":"https://github.com/microsoft/TypeScript/issues/44191"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d23505aa-2bed-21bd-bdb3-bb9333cc2854 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CEBA:27E5CD:32EE5D2:41244A8:6B01CDAF |
| html-safe-nonce | 1fbcfd4ef65addcaa390526a713cc8125d92baa892774da09578eb28691cfa5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUJBOjI3RTVDRDozMkVFNUQyOjQxMjQ0QTg6NkIwMUNEQUYiLCJ2aXNpdG9yX2lkIjoiMjc3MjUyMjkwNDU3ODAxODczNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b7d2a3844a6d273212ef5924d8510b4c933221a4b9db1cc308910747b29c1acf |
| hovercard-subject-tag | issue:897513658 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/44191/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a394c8e27d6a6876ff878565c4b7e22aec795bfe2939f375d8191e0dff273838/microsoft/TypeScript/issues/44191 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a394c8e27d6a6876ff878565c4b7e22aec795bfe2939f375d8191e0dff273838/microsoft/TypeScript/issues/44191 |
| og:image:alt | lib Update Request Configuration Check My compilation target is ES2020 and my lib is the default. Missing / Incorrect Definition TypedArray constructors allows passing (TypedArray, byteOffset, byte... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tjjfvi |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width