@@ -6,7 +6,7 @@ import _CJavaScriptKit
66
77public protocol TypedArrayElement : JSValueConvertible , JSValueConstructible {
88 static var typedArrayKind : JavaScriptTypedArrayKind { get }
9- static var typedArrayClass : JSFunctionRef { get }
9+ static var typedArrayClass : JSFunction { get }
1010}
1111
1212public class JSTypedArray < Element> : JSValueConvertible , ExpressibleByArrayLiteral where Element: TypedArrayElement {
@@ -23,7 +23,7 @@ public class JSTypedArray<Element>: JSValueConvertible, ExpressibleByArrayLitera
2323 setJSValue ( this: ref, index: Int32 ( index) , value: newValue. jsValue ( ) )
2424 }
2525 }
26-
26+
2727 // This private initializer assumes that the passed object is TypedArray
2828 private init ( unsafe object: JSObject ) {
2929 self . ref = object
@@ -70,16 +70,16 @@ func valueForBitWidth<T>(typeName: String, bitWidth: Int, when32: T) -> T {
7070}
7171
7272extension Int : TypedArrayElement {
73- public static var typedArrayClass : JSFunctionRef {
74- valueForBitWidth ( typeName: " Int " , bitWidth: Int . bitWidth, when32: JSObjectRef . global. Int32Array) . function!
73+ public static var typedArrayClass : JSFunction {
74+ valueForBitWidth ( typeName: " Int " , bitWidth: Int . bitWidth, when32: JSObject . global. Int32Array) . function!
7575 }
7676 public static var typedArrayKind : JavaScriptTypedArrayKind {
7777 valueForBitWidth ( typeName: " Int " , bitWidth: Int . bitWidth, when32: . int32)
7878 }
7979}
8080extension UInt : TypedArrayElement {
81- public static var typedArrayClass : JSFunctionRef {
82- valueForBitWidth ( typeName: " UInt " , bitWidth: Int . bitWidth, when32: JSObjectRef . global. Uint32Array) . function!
81+ public static var typedArrayClass : JSFunction {
82+ valueForBitWidth ( typeName: " UInt " , bitWidth: Int . bitWidth, when32: JSObject . global. Uint32Array) . function!
8383 }
8484 public static var typedArrayKind : JavaScriptTypedArrayKind {
8585 valueForBitWidth ( typeName: " UInt " , bitWidth: UInt . bitWidth, when32: . uint32)
@@ -89,30 +89,30 @@ extension UInt: TypedArrayElement {
8989// MARK: - Concrete TypedArray classes
9090
9191extension Int8 : TypedArrayElement {
92- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Int8Array. function! }
92+ public static var typedArrayClass : JSFunction { JSObject . global. Int8Array. function! }
9393 public static var typedArrayKind : JavaScriptTypedArrayKind { . int8 }
9494}
9595extension UInt8 : TypedArrayElement {
96- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Uint8Array. function! }
96+ public static var typedArrayClass : JSFunction { JSObject . global. Uint8Array. function! }
9797 public static var typedArrayKind : JavaScriptTypedArrayKind { . uint8 }
9898}
9999// TODO: Support Uint8ClampedArray?
100100
101101extension Int16 : TypedArrayElement {
102- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Int16Array. function! }
102+ public static var typedArrayClass : JSFunction { JSObject . global. Int16Array. function! }
103103 public static var typedArrayKind : JavaScriptTypedArrayKind { . int16 }
104104}
105105extension UInt16 : TypedArrayElement {
106- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Uint16Array. function! }
106+ public static var typedArrayClass : JSFunction { JSObject . global. Uint16Array. function! }
107107 public static var typedArrayKind : JavaScriptTypedArrayKind { . uint16 }
108108}
109109
110110extension Int32 : TypedArrayElement {
111- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Int32Array. function! }
111+ public static var typedArrayClass : JSFunction { JSObject . global. Int32Array. function! }
112112 public static var typedArrayKind : JavaScriptTypedArrayKind { . int32 }
113113}
114114extension UInt32 : TypedArrayElement {
115- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Uint32Array. function! }
115+ public static var typedArrayClass : JSFunction { JSObject . global. Uint32Array. function! }
116116 public static var typedArrayKind : JavaScriptTypedArrayKind { . uint32 }
117117}
118118
@@ -127,10 +127,10 @@ extension UInt32: TypedArrayElement {
127127//}
128128
129129extension Float32 : TypedArrayElement {
130- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Float32Array. function! }
130+ public static var typedArrayClass : JSFunction { JSObject . global. Float32Array. function! }
131131 public static var typedArrayKind : JavaScriptTypedArrayKind { . float32 }
132132}
133133extension Float64 : TypedArrayElement {
134- public static var typedArrayClass : JSFunctionRef { JSObjectRef . global. Float64Array. function! }
134+ public static var typedArrayClass : JSFunction { JSObject . global. Float64Array. function! }
135135 public static var typedArrayKind : JavaScriptTypedArrayKind { . float64 }
136136}
0 commit comments