-
Notifications
You must be signed in to change notification settings - Fork 20
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
revised API and implementation #37
Open
hhas
wants to merge
28
commits into
lukaskollmer:master
Choose a base branch
from
hhas:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… also now caches method wrappers (ObjC's method introspection APIs are heinously slow, so this caching provides ~1000× speedup on repeated method calls!); caution: this is all *very* Work In Progress (lots of stuff is incomplete/inconsistent/broken/mis-commented/to be redone; including JS↔︎NS type conversions, inout args, unit tests, docs, etc, etc)
…speed is much improved without breaking behavior)
… we finish codecs redesign) * renamed `selectorForMethodName` to `Selector.fromjs` (this allows users to create Selector objects from both "foo:bar:" and "foo_bar_" strings) * various rejigging of internal API designs
* added `Selector.tojs()` * `callObjCMethod` now includes object and method name in error messages * added extra debug logging/error handling to `introspectMethod`
* temporary fixes for `void*` inout arguments (pass a Buffer for now), argument encodings containing inout/out/etc modifiers
…sses a third argument to handler’s `get` which is the proxy object itself, so use that—*not* `this`, which is the handler object only—to call additional ObjC methods on the object)
…ns are TBD, but these should do for now)
….inspect(objc)` result * sorting out (touch-wood) `util.inspect.custom` support
* revised `ns`, `js` functions take function/value as optional 2nd argument, allowing handling of unconverted values to be customized * updated examples
…[util.inspect.custom]` and `Proxy` behave sensibly together
…ons, streamlining packing and unpacking of method arguments and results
… dog-slow overall; which might be ffi overhead) * moved `swizzle` back to its own module, updating implementation (not yet tested) * redesigned block API, dividing it into `BlockType` and `Block` (not yet tested, and `BlockType` is not yet fully ref-napi compatible)
…from `ref-struct-di`, with `objc.structs.define` function for defining new struct types, and already-created struct types being cached and exported as `objc.structs.NAME` (note: `ref*` types may eventually go away, or at least be relegated to 'slow fallback' as there is are severe performance bottlenecks in `ref-napi` and `ffi-napi`; thus users should use ObjC encoding strings rather than `objc.types...` when defining new struct types)
…se are currently publicly exported as `objc.blocks` and `objc.structs` but should eventually merge into top-level `objc` namespace) * various renamings of public classes for consistency (TBD: should they all have `ObjC` prefix or not; on one hand it may make troubleshooting easier as their names are otherwise very generic; on the other, name prefixing is verbose and clumsy) * reworked CommonJS `require` and `module.exports` usage to allow for circular dependencies (i.e. 1. attach to `module.exports` instead of replacing it; and 2. bind the whole module returned by `require`, not parts of it)
…ion, example script, and docs to use current APIs (its own API is still TBD) * struct and block types should now be accessible via `objc`, although this is currently kludgy and doesn’t detect/prevent ObjC namespace collisions (which is a problem in current `objc.blocks` and `objc.structs` API design)
…`objc` object) * simplified subclassing API (encodings object is now passed as argument before methods object) * tidying code, comments, docs
…red parser object isn't thread safe) * added `objc.auto()` convenience function, equivalent to `@autoreleasepool {...}` * tidied comments
# Conflicts: # src/instance.js # src/objctypes.js # test/test-inout.js
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TO DO: