Skip to content

fix(ffi): honor derived receivers in native class static allocators - #61

Open
NathanWalker wants to merge 1 commit into
mainfrom
fix/ffi-derived-static-allocators
Open

fix(ffi): honor derived receivers in native class static allocators#61
NathanWalker wants to merge 1 commit into
mainfrom
fix/ffi-derived-static-allocators

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@nativescript/core allocates TypeScript-derived native classes via
'_super.new.call(this)' (e.g. NotificationObserver extends NSObject with
ObjCExposedMethods). The base wrapper's 'new' and 'alloc' ignored the
receiver and always allocated the base Objective-C class, so observers were
plain NSObject instances and NSNotificationCenter callouts crashed with
'-[NSObject onReceive]: unrecognized selector'. Redirect to the receiver's
materialized class wrapper when the receiver is a TypeScript-derived native
class constructor.

Found while bringing @nativescript/core up on the ios-quickjs runtime flavor. The seven fixes in this series were validated together on the iOS 26.5 simulator (combined branch: fix/run-main-application-entry): a SolidJS + dominative app boots, renders, and runs stably with all of them applied. Each PR is independent and cherry-picked onto main.

🤖 Generated with Claude Code

@nativescript/core allocates TypeScript-derived native classes via
'_super.new.call(this)' (e.g. NotificationObserver extends NSObject with
ObjCExposedMethods). The base wrapper's 'new' and 'alloc' ignored the
receiver and always allocated the base Objective-C class, so observers were
plain NSObject instances and NSNotificationCenter callouts crashed with
'-[NSObject onReceive]: unrecognized selector'. Redirect to the receiver's
materialized class wrapper when the receiver is a TypeScript-derived native
class constructor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ac160a3-ea7e-4457-a7e5-483168322063

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@NathanWalker
NathanWalker marked this pull request as ready for review August 9, 2026 17:01
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