Skip to content

Conversation

@preco21
Copy link
Contributor

@preco21 preco21 commented Mar 6, 2018

Fixes #656.

This is the one of long standing issue, where ESLint crashes when you are trying to use object-rest on namespace import:

import * as names from './named-exports';
const {a, b, ...rest} = names; // Cannot read property 'type' of undefined

Also, I have noticed that it's only caused on variable declarations (in the other words, it does not crash on assignment expressions):

import * as names from './named-exports';
let a, b, rest;
({a, b, ...rest} = names); // Nothing happens

I don't know if this is a right solution, but I think it's going to be okay ever since I found that it does not crash when it's not using variable declarations.

I will add notes to changelog and documents once this has confirmed.

@ljharb ljharb added the bug label Mar 6, 2018
@coveralls
Copy link

coveralls commented Mar 7, 2018

Coverage Status

Coverage increased (+0.004%) to 96.234% when pulling 1a084cc on preco21:namespace-crash-fix into 196c238 on benmosher:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants