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

NativeFunctionInvocationFixer - Don't consider imported functions global #4251

Open
wants to merge 2 commits into
base: 2.12
from

Conversation

Projects
None yet
3 participants
@jyggen
Copy link

jyggen commented Jan 10, 2019

This PR fixes #3051 by making sure that FunctionsAnalyzer::isGlobalFunctionCall() only returns true if the function name isn't imported using use function.

Running NamespaceUsesAnalyzer::getDeclarationsFromTokens() on the same set of tokens over and over again (in for example NativeFunctionInvocationFixer, where FunctionsAnalyzer::isGlobalFunctionCall() is called within a loop) feels suboptimal, but not sure what a better solution would be.

@julienfalque julienfalque changed the title Don't consider imported functions global NativeFunctionInvocationFixer - Don't consider imported functions global Jan 10, 2019

@julienfalque julienfalque added the bug label Jan 10, 2019

@jyggen jyggen force-pushed the jyggen:bugfix-3051 branch from 487f829 to 0afd751 Jan 10, 2019

@bendavies

This comment has been minimized.

Copy link
Contributor

bendavies commented Jan 10, 2019

just came across this bug. thanks for the fix!

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