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

Ensure proper binding for dynamically generated functions. #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gagern
Copy link

@gagern gagern commented Feb 16, 2015

Many places in numeric.js create new functions using the Function(...)
constructor. Such functions do not have access to the local scope.
Therefore they bind to the global "numeric" object, which might not exist,
or might belong to a different version of numeric.js, or might be something
different altogether. Since we are careful enough to have a local variable
in most places, it appears prudent to make sure that we pass this to
functions created from source strings as well.

The code is untested so far.

Many places in numeric.js create new functions using the Function(...)
constructor.  Such functions do not have access to the local scope.
Therefore they bind to the global "numeric" object, which might not exist,
or might belong to a different version of numeric.js, or might be something
different altogether.  Since we are careful enough to have a local variable
in most places, it appears prudent to make sure that we pass this to
functions created from source strings as well.
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.

1 participant