Skip to content

Commit

Permalink
Fix host build
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed May 8, 2024
1 parent 36af1cb commit ae81bfa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Sources/JavaScriptKit/XcodeSupport.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import _CJavaScriptKit

/// Note:
/// Define all runtime function stubs which are imported from JavaScript environment.
/// SwiftPM doesn't support WebAssembly target yet, so we need to define them to
/// avoid link failure.
/// When running with JavaScript runtime library, they are ignored completely.
/// Define stubs for runtime functions which are usually imported from JavaScript environment.
/// JavaScriptKit itself supports only WebAssembly target, but it should be able
/// to be built for host platforms like macOS or Linux for tentative IDE support.
/// (ideally, IDE should build for WebAssembly target though)
#if !arch(wasm32)
func _set_prop(
_: JavaScriptObjectRef,
Expand Down Expand Up @@ -99,4 +99,5 @@ import _CJavaScriptKit
_: UnsafeMutablePointer<UInt8>!
) { fatalError() }
func _release(_: JavaScriptObjectRef) { fatalError() }
func _unsafe_event_loop_yield() { fatalError() }
#endif

0 comments on commit ae81bfa

Please sign in to comment.