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

removed circular requires #63

Closed
wants to merge 10 commits into from
Closed

removed circular requires #63

wants to merge 10 commits into from

Conversation

justinfreitag-zz
Copy link
Contributor

I've gone through lib and test to remove the circular requires that center around ffi.js. My reason for doing this was to get the code (including libffi) working as a native module.

@TooTallNate
Copy link
Member

Cool thanks, I've been meaning to do that. Looks mostly good, except you're changing the public api a lot, which is bad and unnecessary. I'll address some of them inline, but also, all the changes to test should be reverted, since that also should only test the public API.

My reason for doing this was to get the code (including libffi) working as a native module.

What does that mean exactly? node-ffi is a native module so I'm confused.

@@ -7,41 +7,6 @@ var bindings = require('./bindings')
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change the name of this file? It's the entry point to the module as described in the package.json, so with it renamed the entry point is missing.

@justinfreitag-zz
Copy link
Contributor Author

by 'native module' I meant 'core native', adding libffi as a dependency on core -- its part of a personal project. i'll have a go at restoring the public interface now (essentially ffi.js) and revert the tests.

@justinfreitag-zz
Copy link
Contributor Author

restored the public api and reverted tests.

, EXT = ffi.LIB_EXT
, RTLD_NOW = ffi.DynamicLibrary.FLAGS.RTLD_NOW
, RTLD_NOW = DynamicLibrary.FLAGS.RTLD_NOW
, EXT = {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of defining this twice (here and in ffi.js), export it here as Library.EXT = EXT, and then re-export it in ffi.js as ffi.LIB_EXT = ffi.Library.EXT.

@TooTallNate
Copy link
Member

Very good man a couple more things and then it looks great. Also, what's with that test/.callback.js.swp file?

@justinfreitag-zz
Copy link
Contributor Author

my bad, I wrongly assumed there was a friendly .gitignore file in the repo. it's cleaned up now together with the duplicate LIB_EXT definitions and type.js comments

@TooTallNate
Copy link
Member

Thanks @justinfreitag, merged in 0a556e9.

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