Skip to content

Commit adfe1e8

Browse files
Don't escape JSFunction self
1 parent 0f53ca5 commit adfe1e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/JavaScriptKit/FundamentalObjects/JSFunction.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public class JSFunction: JSObject {
9898
}
9999

100100
final func invokeNonThrowingJSFunction(arguments: [ConvertibleToJSValue]) -> RawJSValue {
101-
arguments.withRawJSValues { rawValues in
101+
let id = self.id
102+
return arguments.withRawJSValues { rawValues in
102103
rawValues.withUnsafeBufferPointer { bufferPointer in
103104
let argv = bufferPointer.baseAddress
104105
let argc = bufferPointer.count
@@ -118,7 +119,8 @@ public class JSFunction: JSObject {
118119
}
119120

120121
final func invokeNonThrowingJSFunction(arguments: [ConvertibleToJSValue], this: JSObject) -> RawJSValue {
121-
arguments.withRawJSValues { rawValues in
122+
let id = self.id
123+
return arguments.withRawJSValues { rawValues in
122124
rawValues.withUnsafeBufferPointer { bufferPointer in
123125
let argv = bufferPointer.baseAddress
124126
let argc = bufferPointer.count

0 commit comments

Comments
 (0)