@@ -19,10 +19,12 @@ public class ArrayBuffer: JSBridgedClass {
19
19
20
20
public let jsObject : JSObject
21
21
22
+ @inlinable
22
23
public required init ( unsafelyWrapping jsObject: JSObject ) {
23
24
self . jsObject = jsObject
24
25
}
25
26
27
+ @inlinable
26
28
public convenience init ( length: Int ) {
27
29
self . init ( unsafelyWrapping: Self . constructor!. new ( length) )
28
30
}
@@ -38,37 +40,46 @@ public class SharedArrayBuffer: JSBridgedClass {
38
40
39
41
public let jsObject : JSObject
40
42
43
+ @inlinable
41
44
public required init ( unsafelyWrapping jsObject: JSObject ) {
42
45
self . jsObject = jsObject
43
46
}
44
47
48
+ @inlinable
45
49
public convenience init ( length: Int ) {
46
50
self . init ( unsafelyWrapping: Self . constructor!. new ( length) )
47
51
}
48
52
53
+ @inlinable
49
54
public convenience init ( length: Int , maxByteLength: Int ) {
50
55
self . init ( unsafelyWrapping: Self . constructor!. new ( length, [ " maxByteLength " : maxByteLength] ) )
51
56
}
52
57
58
+ @inlinable
53
59
public var byteLength : Int {
54
60
Int ( jsObject. byteLength. number!)
55
61
}
56
62
63
+ @inlinable
57
64
public var growable : Bool {
58
65
jsObject. growable. boolean!
59
66
}
60
67
68
+ @inlinable
61
69
public var maxByteLength : Int {
62
70
Int ( jsObject. maxByteLength. number!)
63
71
}
64
72
73
+ @inlinable
65
74
public func grow( newLength: Int ) {
66
75
_ = jsObject. grow!( newLength)
67
76
}
68
77
78
+ @inlinable
69
79
public func slice( begin: Int ) -> SharedArrayBuffer {
70
80
jsObject. slice!( begin) . fromJSValue ( ) !
71
81
}
82
+ @inlinable
72
83
public func slice( begin: Int , end: Int ) -> SharedArrayBuffer {
73
84
jsObject. slice!( begin, end) . fromJSValue ( ) !
74
85
}
0 commit comments