Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#656: Fix crashes that caused when using object-rest properties in namespace rule #1039

Merged
merged 2 commits into from
Mar 7, 2018

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