-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I encountered an error when using the rest operator when destructuring a function parameter.
My test source code like this:
var a = {name:'hi', age:11};
function foo(e={...a}){}The error info like this:
TypeError: Cannot read property 'type' of undefined
at Object.Property (/Users/curry/test/node_modules/typhonjs-escomplex-commons/dist/utils/ast/astSyntax.js:814:30)
at ObjectExpression (/Users/curry/test/node_modules/typhonjs-escomplex-commons/dist/utils/ast/astSyntax.js:779:18)
at Object.AssignmentPattern (/Users/curry/test/node_modules/typhonjs-escomplex-commons/dist/utils/ast/astSyntax.js:908:28)
at Function.parse (/Users/curry/test/node_modules/typhonjs-escomplex-commons/dist/utils/ast/ASTGenerator.js:66:39)
at /Users/curry/test/node_modules/escomplex-plugin-syntax-estree/dist/PluginSyntaxESTree.js:491:61
at Array.forEach (<anonymous>)
at Trait._data (/Users/curry/test/node_modules/escomplex-plugin-syntax-estree/dist/PluginSyntaxESTree.js:490:28)
at Trait.valueOf (/Users/curry/test/node_modules/typhonjs-escomplex-commons/dist/module/traits/Trait.js:86:60)
at Object.enterNode (/Users/curry/test/node_modules/typhonjs-escomplex-module/dist/ESComplexModule.js:114:53)
at ASTWalker._visitNode (/Users/curry/test/node_modules/typhonjs-ast-walker/dist/ASTWalker.js:72:88)
I have tried the method in #11 , but it does not work. So any help?
Dependencies versions:
Metadata
Metadata
Assignees
Labels
No labels