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

Prevent exception if eval called with non-string argument in bab-defuser #4373

Merged
merged 2 commits into from Dec 23, 2018

Conversation

alhimik45
Copy link
Contributor

From MDN:

If the argument of eval() is not a string, eval() returns the argument unchanged.

But eval wrapper in bab-defuser violates this contract: site's scripts get exceptions from check function if pass numbers or functions to eval:

Uncaught TypeError: s.indexOf is not a function
    at check (<anonymous>:23:57)

This pull request adds cheking of argument type.

@alhimik45 alhimik45 changed the title Prevent exception if eval called with non-string argument Prevent exception if eval called with non-string argument in bab-defuser Dec 23, 2018
@mapx-
Copy link
Contributor

mapx- commented Dec 23, 2018

@gorhill

@gorhill
Copy link
Member

gorhill commented Dec 23, 2018

Thanks for catching this.

Could you just change the double-quotes to single-quotes to be consistent with the rest of the file?

@alhimik45
Copy link
Contributor Author

done

@gorhill gorhill merged commit 40c3847 into uBlockOrigin:master Dec 23, 2018
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.

None yet

3 participants