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

[[FIX]] Avoid crashing on invalid input #3046

Merged
merged 1 commit into from
Oct 17, 2016

Conversation

jugglinmike
Copy link
Member

A recent extension to the instanceof operator introduced logic that
performed property access on the result of parsing the operator's
right-hand expression operand. Because invalid code may not specify such
an expression, this logic led to program crashes in response to the
invalid syntax.

Ensure that when the instanceof operator appears without a right-hand
expression operand, JSHint reports a syntax error and exits gracefully.

This should resolve gh-3039. @rwaldron mind taking a look?

A recent extension to the `instanceof` operator introduced logic that
performed property access on the result of parsing the operator's
right-hand expression operand. Because invalid code may not specify such
an expression, this logic led to program crashes in response to the
invalid syntax.

Ensure that when the `instanceof` operator appears without a right-hand
expression operand, JSHint reports a syntax error and exits gracefully.
@coveralls
Copy link

coveralls commented Oct 17, 2016

Coverage Status

Coverage increased (+0.001%) to 97.724% when pulling 3ac0029 on jugglinmike:3039-instanceof-crash into 5ba6d94 on jshint:master.

// `expression` function.
if (!right) {
return token;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple!

@rwaldron rwaldron merged commit bec152c into jshint:master Oct 17, 2016
@jugglinmike
Copy link
Member Author

Thanks, Rick!

jugglinmike added a commit to jugglinmike/jshint that referenced this pull request Oct 18, 2016
A recent extension to the `instanceof` operator introduced logic that
performed property access on the result of parsing the operator's
right-hand expression operand. Because invalid code may not specify such
an expression, this logic led to program crashes in response to the
invalid syntax.

Ensure that when the `instanceof` operator appears without a right-hand
expression operand, JSHint reports a syntax error and exits gracefully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete instanceof crashes
3 participants