diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..3567e20c3 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,26 @@ +name: Documentation + +on: + push: + branches: [master] + +jobs: + swift-doc: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Generate Documentation + uses: MaxDesiatov/swift-doc@prebuilt-image + with: + inputs: "Sources" + module-name: JavaScriptKit + format: html + base-url: "/JavaScriptKit" + output: ./.build/documentation + - run: sudo chmod o+r -R ./.build/documentation + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./.build/documentation diff --git a/Sources/JavaScriptKit/BasicObjects/JSError.swift b/Sources/JavaScriptKit/BasicObjects/JSError.swift index be1760772..fe779cc61 100644 --- a/Sources/JavaScriptKit/BasicObjects/JSError.swift +++ b/Sources/JavaScriptKit/BasicObjects/JSError.swift @@ -1,4 +1,4 @@ -/** A wrapper around the [JavaScript Error +/** A wrapper around [the JavaScript Error class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) that exposes its properties in a type-safe way. */ @@ -24,7 +24,7 @@ public final class JSError: Error { jsObject.name.string! } - /// The JavaScript call trace that led to the creation of this error object. + /// The JavaScript call stack that led to the creation of this error object. public var stack: String? { jsObject.stack.string } diff --git a/Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift b/Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift index 8379b175f..92a52d0be 100644 --- a/Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift +++ b/Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift @@ -105,18 +105,18 @@ public class JSClosure: JSFunction { } @_cdecl("swjs_prepare_host_function_call") -public func _prepare_host_function_call(_ argc: Int32) -> UnsafeMutableRawPointer { +func _prepare_host_function_call(_ argc: Int32) -> UnsafeMutableRawPointer { let argumentSize = MemoryLayout.size * Int(argc) return malloc(Int(argumentSize))! } @_cdecl("swjs_cleanup_host_function_call") -public func _cleanup_host_function_call(_ pointer: UnsafeMutableRawPointer) { +func _cleanup_host_function_call(_ pointer: UnsafeMutableRawPointer) { free(pointer) } @_cdecl("swjs_call_host_function") -public func _call_host_function( +func _call_host_function( _ hostFuncRef: JavaScriptHostFuncRef, _ argv: UnsafePointer, _ argc: Int32, _ callbackFuncRef: JavaScriptObjectRef