@@ -7,15 +7,15 @@ import _CJavaScriptKit
77public protocol TypedArrayElement {
88 associatedtype Element : ConvertibleToJSValue , Construct ibleFromJSValue = Self
99 /// The constructor function for the TypedArray class for this particular kind of number
10- static var typedArrayClass : JSFunction { get }
10+ static var typedArrayClass : JSObject { get }
1111}
1212
1313/// A wrapper around all [JavaScript `TypedArray`
1414/// classes](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)
1515/// that exposes their properties in a type-safe way.
1616public final class JSTypedArray < Traits> : JSBridgedClass , ExpressibleByArrayLiteral where Traits: TypedArrayElement {
1717 public typealias Element = Traits . Element
18- public class var constructor : JSFunction ? { Traits . typedArrayClass }
18+ public class var constructor : JSObject ? { Traits . typedArrayClass }
1919 public var jsObject : JSObject
2020
2121 public subscript( _ index: Int ) -> Element {
@@ -141,64 +141,64 @@ public final class JSTypedArray<Traits>: JSBridgedClass, ExpressibleByArrayLiter
141141}
142142
143143extension Int : TypedArrayElement {
144- public static var typedArrayClass : JSFunction {
144+ public static var typedArrayClass : JSObject {
145145 #if _pointerBitWidth(_32)
146- return JSObject . global. Int32Array. function !
146+ return JSObject . global. Int32Array. object !
147147 #elseif _pointerBitWidth(_64)
148- return JSObject . global. Int64Array. function !
148+ return JSObject . global. Int64Array. object !
149149 #else
150150 #error("Unsupported pointer width")
151151 #endif
152152 }
153153}
154154
155155extension UInt : TypedArrayElement {
156- public static var typedArrayClass : JSFunction {
156+ public static var typedArrayClass : JSObject {
157157 #if _pointerBitWidth(_32)
158- return JSObject . global. Uint32Array. function !
158+ return JSObject . global. Uint32Array. object !
159159 #elseif _pointerBitWidth(_64)
160- return JSObject . global. Uint64Array. function !
160+ return JSObject . global. Uint64Array. object !
161161 #else
162162 #error("Unsupported pointer width")
163163 #endif
164164 }
165165}
166166
167167extension Int8 : TypedArrayElement {
168- public static var typedArrayClass : JSFunction { JSObject . global. Int8Array. function ! }
168+ public static var typedArrayClass : JSObject { JSObject . global. Int8Array. object ! }
169169}
170170
171171extension UInt8 : TypedArrayElement {
172- public static var typedArrayClass : JSFunction { JSObject . global. Uint8Array. function ! }
172+ public static var typedArrayClass : JSObject { JSObject . global. Uint8Array. object ! }
173173}
174174
175175extension Int16 : TypedArrayElement {
176- public static var typedArrayClass : JSFunction { JSObject . global. Int16Array. function ! }
176+ public static var typedArrayClass : JSObject { JSObject . global. Int16Array. object ! }
177177}
178178
179179extension UInt16 : TypedArrayElement {
180- public static var typedArrayClass : JSFunction { JSObject . global. Uint16Array. function ! }
180+ public static var typedArrayClass : JSObject { JSObject . global. Uint16Array. object ! }
181181}
182182
183183extension Int32 : TypedArrayElement {
184- public static var typedArrayClass : JSFunction { JSObject . global. Int32Array. function ! }
184+ public static var typedArrayClass : JSObject { JSObject . global. Int32Array. object ! }
185185}
186186
187187extension UInt32 : TypedArrayElement {
188- public static var typedArrayClass : JSFunction { JSObject . global. Uint32Array. function ! }
188+ public static var typedArrayClass : JSObject { JSObject . global. Uint32Array. object ! }
189189}
190190
191191extension Float32 : TypedArrayElement {
192- public static var typedArrayClass : JSFunction { JSObject . global. Float32Array. function ! }
192+ public static var typedArrayClass : JSObject { JSObject . global. Float32Array. object ! }
193193}
194194
195195extension Float64 : TypedArrayElement {
196- public static var typedArrayClass : JSFunction { JSObject . global. Float64Array. function ! }
196+ public static var typedArrayClass : JSObject { JSObject . global. Float64Array. object ! }
197197}
198198
199199public enum JSUInt8Clamped : TypedArrayElement {
200200 public typealias Element = UInt8
201- public static var typedArrayClass : JSFunction { JSObject . global. Uint8ClampedArray. function ! }
201+ public static var typedArrayClass : JSObject { JSObject . global. Uint8ClampedArray. object ! }
202202}
203203
204204public typealias JSUInt8ClampedArray = JSTypedArray < JSUInt8Clamped >
0 commit comments