Skip to content

Commit ed1fff3

Browse files
committed
+ inlinable
1 parent 1c6e9bd commit ed1fff3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sources/ECMAScript/ArrayBuffer.swift

+11
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ public class ArrayBuffer: JSBridgedClass {
1919

2020
public let jsObject: JSObject
2121

22+
@inlinable
2223
public required init(unsafelyWrapping jsObject: JSObject) {
2324
self.jsObject = jsObject
2425
}
2526

27+
@inlinable
2628
public convenience init(length: Int) {
2729
self.init(unsafelyWrapping: Self.constructor!.new(length))
2830
}
@@ -38,37 +40,46 @@ public class SharedArrayBuffer: JSBridgedClass {
3840

3941
public let jsObject: JSObject
4042

43+
@inlinable
4144
public required init(unsafelyWrapping jsObject: JSObject) {
4245
self.jsObject = jsObject
4346
}
4447

48+
@inlinable
4549
public convenience init(length: Int) {
4650
self.init(unsafelyWrapping: Self.constructor!.new(length))
4751
}
4852

53+
@inlinable
4954
public convenience init(length: Int, maxByteLength: Int) {
5055
self.init(unsafelyWrapping: Self.constructor!.new(length, ["maxByteLength": maxByteLength]))
5156
}
5257

58+
@inlinable
5359
public var byteLength: Int {
5460
Int(jsObject.byteLength.number!)
5561
}
5662

63+
@inlinable
5764
public var growable: Bool {
5865
jsObject.growable.boolean!
5966
}
6067

68+
@inlinable
6169
public var maxByteLength: Int {
6270
Int(jsObject.maxByteLength.number!)
6371
}
6472

73+
@inlinable
6574
public func grow(newLength: Int) {
6675
_ = jsObject.grow!(newLength)
6776
}
6877

78+
@inlinable
6979
public func slice(begin: Int) -> SharedArrayBuffer {
7080
jsObject.slice!(begin).fromJSValue()!
7181
}
82+
@inlinable
7283
public func slice(begin: Int, end: Int) -> SharedArrayBuffer {
7384
jsObject.slice!(begin, end).fromJSValue()!
7485
}

0 commit comments

Comments
 (0)