From c35d6863820cf3519aabbbd7ea2408da8b16b3c6 Mon Sep 17 00:00:00 2001 From: Strega's Gate <55062873+STREGAsGate@users.noreply.github.com> Date: Wed, 5 Apr 2023 23:26:17 -0400 Subject: [PATCH 1/2] Fix bugs Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift Update Generated.swift --- Sources/Gamepad/Generated.swift | 16 ++++------------ Sources/WebAudio/Generated.swift | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Sources/Gamepad/Generated.swift b/Sources/Gamepad/Generated.swift index ab05169d..8b303b8c 100644 --- a/Sources/Gamepad/Generated.swift +++ b/Sources/Gamepad/Generated.swift @@ -362,22 +362,14 @@ public class GamepadTouch: JSBridgedClass { public var surfaceDimensions: Uint32Array? } -public class Navigator: JSBridgedClass { - @inlinable public class var constructor: JSFunction? { JSObject.global[Strings.Navigator].function } - - public let jsObject: JSObject - - public required init(unsafelyWrapping jsObject: JSObject) { - self.jsObject = jsObject - } - - @inlinable public func getGamepads() -> [Gamepad?] { +public extension Navigator { + @inlinable func getGamepads() -> [Gamepad?] { let this = jsObject - return this[Strings.getGamepads].function!(this: this, arguments: []).fromJSValue()! + let jsArray = JSArray(unsafelyWrapping: this[Strings.getGamepads].function!(this: this, arguments: []).object!) + return jsArray.map({Gamepad(from: $0)}) } } -public protocol WindowEventHandlers: JSBridgedClass {} public extension WindowEventHandlers { @inlinable var ongamepadconnected: EventHandler { get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] } diff --git a/Sources/WebAudio/Generated.swift b/Sources/WebAudio/Generated.swift index 270b021d..2c51935c 100644 --- a/Sources/WebAudio/Generated.swift +++ b/Sources/WebAudio/Generated.swift @@ -492,7 +492,7 @@ public class AudioNode: EventTarget { super.init(unsafelyWrapping: jsObject) } - @inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self { + @discardableResult @inlinable public func connect(destinationNode: NodeType, output: UInt32? = nil, input: UInt32? = nil) -> NodeType { let this = jsObject return this[Strings.connect].function!(this: this, arguments: [_toJSValue(destinationNode), _toJSValue(output), _toJSValue(input)]).fromJSValue()! } From 8637e4fe30062fd1f9862d48b3b905bc5d6368d2 Mon Sep 17 00:00:00 2001 From: Strega's Gate <55062873+STREGAsGate@users.noreply.github.com> Date: Mon, 24 Apr 2023 03:28:26 -0400 Subject: [PATCH 2/2] Update Generated.swift --- Sources/WebGL1/Generated.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/WebGL1/Generated.swift b/Sources/WebGL1/Generated.swift index ddea992d..62960b39 100644 --- a/Sources/WebGL1/Generated.swift +++ b/Sources/WebGL1/Generated.swift @@ -1170,7 +1170,7 @@ public extension WebGLRenderingContextBase { @inlinable func getUniformLocation(program: WebGLProgram, name: String) -> WebGLUniformLocation? { let this = jsObject - return this[Strings.getUniformLocation].function!(this: this, arguments: [_toJSValue(program), _toJSValue(name)]).fromJSValue()! + return this[Strings.getUniformLocation].function!(this: this, arguments: [_toJSValue(program), _toJSValue(name)]).fromJSValue() } @inlinable func getVertexAttrib(index: GLuint, pname: GLenum) -> JSValue {