ReviewOS

zig-utils/zig-js

Bridge: implement JSExport, Objective-C blocks, and interop completion evidence

#160
Closed chris opened this 9 days ago ·
9 days ago

Parent: #138 Depends on: Objective-C inventory, core behavior, and managed lifetime children

Complete callable/exported Objective-C interop and the final bridge evidence matrix.

Acceptance:

  • Implement Objective-C block to JavaScript callable conversion and JavaScript function to block/callable invocation with argument/return conversion and exception propagation.
  • Implement JSExport protocol discovery, inherited protocols/classes, instance/class methods, properties/accessors, initializers/constructors, selector-to-property naming, and JSExportAs.
  • Support the inventoried primitive, object, class-pointer, block, CGPoint/CGSize/CGRect/NSRange, date, collection, typed-array, and error conversions.
  • Preserve wrapper/prototype/constructor identity and method receiver semantics across contexts in one VM; reject cross-VM use.
  • Add Objective-C compile-link-runtime, system-JSC differential, autorelease/lifetime stress, sanitizer/leak, and zero-hidden inventory gates.
  • Update README/API docs and close #138 only when every inventoried entry and conversion row has evidence.
9 days ago

Interop implementation and evidence are complete through 7b37b20: 108/108 declarations, 17-row system-JSC parity (189ef5b0eefd1054), same-VM cross-context exported receiver/constructor/prototype coverage, typed Objective-C blocks, JavaScript JSValue callable invocation, 200-cycle autorelease teardown, ASan+UBSan, and 0-byte Apple leak output. WebKit itself rejects block-typed JSExport arguments because Objective-C exposes only the opaque @? encoding; zig-js likewise avoids inventing an unsafe callable ABI. This issue remains open only to close parent #138 after #159 finishes conditional collection and fault-injection work.

9 days ago

Completed through f29ca38. The bridge covers typed Objective-C blocks, JavaScript callable JSValue invocation, JSExport protocols/classes/properties/constructors/renames, all inventoried conversions, same-VM cross-context identity and receiver semantics, cross-VM rejection, 108/108 inventory, 18-row system-JSC parity (360c1ad3ccf51d6b), 200-cycle lifetime stress, ASan+UBSan, deterministic faults, 0-byte leaks, and published README/API reproduction.

Sign in to comment on this issue.