You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing error for a destructuring pattern inside a rest binding element / rest parameter #2519
D:\TS\built\local\tsc.js:26338
emitDestructuring(p, false, tempParameters[tempIndex
^
TypeError: Cannot read property '0' of undefined
at D:\TS\built\local\tsc.js:26338:71
at Object.forEach (D:\TS\built\local\tsc.js:693:30)
at emitDefaultValueAssignments (D:\TS\built\local\tsc.js:26334:24)
at emitFunctionBodyPreamble (D:\TS\built\local\tsc.js:26521:17)
at emitBlockFunctionBody (D:\TS\built\local\tsc.js:26588:17)
at emitSignatureAndBody (D:\TS\built\local\tsc.js:26506:21)
at emitFunctionDeclaration (D:\TS\built\local\tsc.js:26450:17)
at emitJavaScriptWorker (D:\TS\built\local\tsc.js:28256:32)
at emitNodeWithoutSourceMap (D:\TS\built\local\tsc.js:28146:17)
at emitLinesStartingAt (D:\TS\built\local\tsc.js:24527:21)
Activity
Adjust getTypeFromArrayBindingPattern to return an array if inside a …
yuit commentedon Apr 12, 2015
Following code:
causes crash when compiling:
D:\TS\built\local\tsc.js:26338
emitDestructuring(p, false, tempParameters[tempIndex
^
TypeError: Cannot read property '0' of undefined
at D:\TS\built\local\tsc.js:26338:71
at Object.forEach (D:\TS\built\local\tsc.js:693:30)
at emitDefaultValueAssignments (D:\TS\built\local\tsc.js:26334:24)
at emitFunctionBodyPreamble (D:\TS\built\local\tsc.js:26521:17)
at emitBlockFunctionBody (D:\TS\built\local\tsc.js:26588:17)
at emitSignatureAndBody (D:\TS\built\local\tsc.js:26506:21)
at emitFunctionDeclaration (D:\TS\built\local\tsc.js:26450:17)
at emitJavaScriptWorker (D:\TS\built\local\tsc.js:28256:32)
at emitNodeWithoutSourceMap (D:\TS\built\local\tsc.js:28146:17)
at emitLinesStartingAt (D:\TS\built\local\tsc.js:24527:21)
Disallow binding patterns in binding rest elements (fixes #2519)
rauschma commentedon Dec 28, 2015
ES7/ES2016 will allow this pattern: https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
It was inconsistent with destructuring assignment that has always allowed it: http://www.ecma-international.org/ecma-262/6.0/#sec-destructuring-assignment
DanielRosenwasser commentedon Dec 28, 2015
Thanks for the heads up Axel Rauschmayer (@rauschma)! I've filed #6275.