Skip to content

Commit c35d686

Browse files
Strega's GateStrega's Gate
authored andcommitted
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
1 parent 80cc677 commit c35d686

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

Sources/Gamepad/Generated.swift

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,22 +362,14 @@ public class GamepadTouch: JSBridgedClass {
362362
public var surfaceDimensions: Uint32Array?
363363
}
364364

365-
public class Navigator: JSBridgedClass {
366-
@inlinable public class var constructor: JSFunction? { JSObject.global[Strings.Navigator].function }
367-
368-
public let jsObject: JSObject
369-
370-
public required init(unsafelyWrapping jsObject: JSObject) {
371-
self.jsObject = jsObject
372-
}
373-
374-
@inlinable public func getGamepads() -> [Gamepad?] {
365+
public extension Navigator {
366+
@inlinable func getGamepads() -> [Gamepad?] {
375367
let this = jsObject
376-
return this[Strings.getGamepads].function!(this: this, arguments: []).fromJSValue()!
368+
let jsArray = JSArray(unsafelyWrapping: this[Strings.getGamepads].function!(this: this, arguments: []).object!)
369+
return jsArray.map({Gamepad(from: $0)})
377370
}
378371
}
379372

380-
public protocol WindowEventHandlers: JSBridgedClass {}
381373
public extension WindowEventHandlers {
382374
@inlinable var ongamepadconnected: EventHandler {
383375
get { ClosureAttribute1Optional[Strings.ongamepadconnected, in: jsObject] }

Sources/WebAudio/Generated.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ public class AudioNode: EventTarget {
492492
super.init(unsafelyWrapping: jsObject)
493493
}
494494

495-
@inlinable public func connect(destinationNode: AudioNode, output: UInt32? = nil, input: UInt32? = nil) -> Self {
495+
@discardableResult @inlinable public func connect<NodeType: AudioNode>(destinationNode: NodeType, output: UInt32? = nil, input: UInt32? = nil) -> NodeType {
496496
let this = jsObject
497497
return this[Strings.connect].function!(this: this, arguments: [_toJSValue(destinationNode), _toJSValue(output), _toJSValue(input)]).fromJSValue()!
498498
}

0 commit comments

Comments
 (0)