Skip to content

Commit dde8cf2

Browse files
committed
Propagate names through to the Swift side
1 parent 7971185 commit dde8cf2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Runtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export class SwiftRuntime {
411411
// Call `.slice()` to copy the memory
412412
writeUint32(result_obj, this.heap.retain(array.slice()));
413413
},
414-
swjs_destroy_ref: (ref: ref) => {
414+
swjs_release: (ref: ref) => {
415415
this.heap.release(ref)
416416
}
417417
}

Sources/JavaScriptKit/JSObject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class JSObjectRef: Equatable {
3737
static let _JS_Predef_Value_Global: JavaScriptObjectRef = 0
3838
public static let global = JSObjectRef(id: _JS_Predef_Value_Global)
3939

40-
deinit { _destroy_ref(id) }
40+
deinit { _release(id) }
4141

4242
public static func == (lhs: JSObjectRef, rhs: JSObjectRef) -> Bool {
4343
return lhs.id == rhs.id

Sources/JavaScriptKit/XcodeSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import _CJavaScriptKit
7272
_: JavaScriptHostFuncRef,
7373
_: UnsafePointer<JavaScriptObjectRef>!
7474
) { fatalError() }
75-
func _destroy_ref(_: JavaScriptObjectRef) { fatalError() }
75+
func _release(_: JavaScriptObjectRef) { fatalError() }
7676
func _create_typed_array<T: TypedArrayElement>(
7777
_: JavaScriptTypedArrayKind,
7878
_: UnsafePointer<T>,

Sources/_CJavaScriptKit/include/_CJavaScriptKit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ _create_function(const JavaScriptHostFuncRef host_func_id,
107107
const JavaScriptObjectRef *func_ref_ptr);
108108

109109
__attribute__((__import_module__("javascript_kit"),
110-
__import_name__("swjs_destroy_ref"))) extern void
111-
_destroy_ref(const JavaScriptObjectRef ref);
110+
__import_name__("swjs_release"))) extern void
111+
_release(const JavaScriptObjectRef ref);
112112

113113
__attribute__((
114114
__import_module__("javascript_kit"),

0 commit comments

Comments
 (0)