@@ -18,7 +18,7 @@ public class JSFunction: JSObject {
1818 /// - arguments: Arguments to be passed to this function.
1919 /// - Returns: The result of this call.
2020 @discardableResult
21- public func callAsFunction( this: JSObject , arguments: [ ConvertibleToJSValue ] ) -> JSValue {
21+ override public func callAsFunction( this: JSObject , arguments: [ ConvertibleToJSValue ] ) -> JSValue {
2222 invokeNonThrowingJSFunction ( arguments: arguments, this: this) . jsValue
2323 }
2424
@@ -27,20 +27,20 @@ public class JSFunction: JSObject {
2727 /// - arguments: Arguments to be passed to this function.
2828 /// - Returns: The result of this call.
2929 @discardableResult
30- public func callAsFunction( arguments: [ ConvertibleToJSValue ] ) -> JSValue {
30+ override public func callAsFunction( arguments: [ ConvertibleToJSValue ] ) -> JSValue {
3131 invokeNonThrowingJSFunction ( arguments: arguments) . jsValue
3232 }
3333
3434 /// A variadic arguments version of `callAsFunction`.
3535 @discardableResult
36- public func callAsFunction( this: JSObject , _ arguments: ConvertibleToJSValue ... ) -> JSValue {
37- self ( this: this, arguments: arguments)
36+ override public func callAsFunction( this: JSObject , _ arguments: ConvertibleToJSValue ... ) -> JSValue {
37+ self . callAsFunction ( this: this, arguments: arguments)
3838 }
3939
4040 /// A variadic arguments version of `callAsFunction`.
4141 @discardableResult
42- public func callAsFunction( _ arguments: ConvertibleToJSValue ... ) -> JSValue {
43- self ( arguments: arguments)
42+ override public func callAsFunction( _ arguments: ConvertibleToJSValue ... ) -> JSValue {
43+ self . callAsFunction ( arguments: arguments)
4444 }
4545
4646 /// Instantiate an object from this function as a constructor.
@@ -53,7 +53,7 @@ public class JSFunction: JSObject {
5353 ///
5454 /// - Parameter arguments: Arguments to be passed to this constructor function.
5555 /// - Returns: A new instance of this constructor.
56- public func new( arguments: [ ConvertibleToJSValue ] ) -> JSObject {
56+ override public func new( arguments: [ ConvertibleToJSValue ] ) -> JSObject {
5757 arguments. withRawJSValues { rawValues in
5858 rawValues. withUnsafeBufferPointer { bufferPointer in
5959 JSObject ( id: swjs_call_new ( self . id, bufferPointer. baseAddress!, Int32 ( bufferPointer. count) ) )
@@ -62,7 +62,7 @@ public class JSFunction: JSObject {
6262 }
6363
6464 /// A variadic arguments version of `new`.
65- public func new( _ arguments: ConvertibleToJSValue ... ) -> JSObject {
65+ override public func new( _ arguments: ConvertibleToJSValue ... ) -> JSObject {
6666 new ( arguments: arguments)
6767 }
6868
@@ -87,11 +87,11 @@ public class JSFunction: JSObject {
8787 #endif
8888
8989 @discardableResult
90- public func callAsFunction( arguments: [ JSValue ] ) -> JSValue {
90+ override public func callAsFunction( arguments: [ JSValue ] ) -> JSValue {
9191 invokeNonThrowingJSFunction ( arguments: arguments) . jsValue
9292 }
9393
94- public func new( arguments: [ JSValue ] ) -> JSObject {
94+ override public func new( arguments: [ JSValue ] ) -> JSObject {
9595 arguments. withRawJSValues { rawValues in
9696 rawValues. withUnsafeBufferPointer { bufferPointer in
9797 JSObject ( id: swjs_call_new ( self . id, bufferPointer. baseAddress!, Int32 ( bufferPointer. count) ) )
@@ -107,67 +107,6 @@ public class JSFunction: JSObject {
107107 override public var jsValue : JSValue {
108108 . function( self )
109109 }
110-
111- final func invokeNonThrowingJSFunction( arguments: [ JSValue ] ) -> RawJSValue {
112- arguments. withRawJSValues { invokeNonThrowingJSFunction ( rawValues: $0) }
113- }
114-
115- final func invokeNonThrowingJSFunction( arguments: [ JSValue ] , this: JSObject ) -> RawJSValue {
116- arguments. withRawJSValues { invokeNonThrowingJSFunction ( rawValues: $0, this: this) }
117- }
118-
119- #if !hasFeature(Embedded)
120- final func invokeNonThrowingJSFunction( arguments: [ ConvertibleToJSValue ] ) -> RawJSValue {
121- arguments. withRawJSValues { invokeNonThrowingJSFunction ( rawValues: $0) }
122- }
123-
124- final func invokeNonThrowingJSFunction( arguments: [ ConvertibleToJSValue ] , this: JSObject ) -> RawJSValue {
125- arguments. withRawJSValues { invokeNonThrowingJSFunction ( rawValues: $0, this: this) }
126- }
127- #endif
128-
129- final private func invokeNonThrowingJSFunction( rawValues: [ RawJSValue ] ) -> RawJSValue {
130- rawValues. withUnsafeBufferPointer { [ id] bufferPointer in
131- let argv = bufferPointer. baseAddress
132- let argc = bufferPointer. count
133- var payload1 = JavaScriptPayload1 ( )
134- var payload2 = JavaScriptPayload2 ( )
135- let resultBitPattern = swjs_call_function_no_catch (
136- id,
137- argv,
138- Int32 ( argc) ,
139- & payload1,
140- & payload2
141- )
142- let kindAndFlags = JavaScriptValueKindAndFlags ( bitPattern: resultBitPattern)
143- assert ( !kindAndFlags. isException)
144- let result = RawJSValue ( kind: kindAndFlags. kind, payload1: payload1, payload2: payload2)
145- return result
146- }
147- }
148-
149- final private func invokeNonThrowingJSFunction( rawValues: [ RawJSValue ] , this: JSObject ) -> RawJSValue {
150- rawValues. withUnsafeBufferPointer { [ id] bufferPointer in
151- let argv = bufferPointer. baseAddress
152- let argc = bufferPointer. count
153- var payload1 = JavaScriptPayload1 ( )
154- var payload2 = JavaScriptPayload2 ( )
155- let resultBitPattern = swjs_call_function_with_this_no_catch (
156- this. id,
157- id,
158- argv,
159- Int32 ( argc) ,
160- & payload1,
161- & payload2
162- )
163- let kindAndFlags = JavaScriptValueKindAndFlags ( bitPattern: resultBitPattern)
164- #if !hasFeature(Embedded)
165- assert ( !kindAndFlags. isException)
166- #endif
167- let result = RawJSValue ( kind: kindAndFlags. kind, payload1: payload1, payload2: payload2)
168- return result
169- }
170- }
171110}
172111
173112#if hasFeature(Embedded)
@@ -182,17 +121,17 @@ public class JSFunction: JSObject {
182121extension JSFunction {
183122
184123 @discardableResult
185- public func callAsFunction( this: JSObject ) -> JSValue {
124+ override public func callAsFunction( this: JSObject ) -> JSValue {
186125 invokeNonThrowingJSFunction ( arguments: [ ] , this: this) . jsValue
187126 }
188127
189128 @discardableResult
190- public func callAsFunction( this: JSObject , _ arg0: some ConvertibleToJSValue ) -> JSValue {
129+ override public func callAsFunction( this: JSObject , _ arg0: some ConvertibleToJSValue ) -> JSValue {
191130 invokeNonThrowingJSFunction ( arguments: [ arg0. jsValue] , this: this) . jsValue
192131 }
193132
194133 @discardableResult
195- public func callAsFunction(
134+ override public func callAsFunction(
196135 this: JSObject ,
197136 _ arg0: some ConvertibleToJSValue ,
198137 _ arg1: some ConvertibleToJSValue
@@ -201,7 +140,7 @@ extension JSFunction {
201140 }
202141
203142 @discardableResult
204- public func callAsFunction(
143+ override public func callAsFunction(
205144 this: JSObject ,
206145 _ arg0: some ConvertibleToJSValue ,
207146 _ arg1: some ConvertibleToJSValue ,
@@ -211,7 +150,7 @@ extension JSFunction {
211150 }
212151
213152 @discardableResult
214- public func callAsFunction(
153+ override public func callAsFunction(
215154 this: JSObject ,
216155 _ arg0: some ConvertibleToJSValue ,
217156 _ arg1: some ConvertibleToJSValue ,
@@ -223,7 +162,7 @@ extension JSFunction {
223162 }
224163
225164 @discardableResult
226- public func callAsFunction(
165+ override public func callAsFunction(
227166 this: JSObject ,
228167 _ arg0: some ConvertibleToJSValue ,
229168 _ arg1: some ConvertibleToJSValue ,
@@ -238,7 +177,7 @@ extension JSFunction {
238177 }
239178
240179 @discardableResult
241- public func callAsFunction(
180+ override public func callAsFunction(
242181 this: JSObject ,
243182 _ arg0: some ConvertibleToJSValue ,
244183 _ arg1: some ConvertibleToJSValue ,
@@ -254,7 +193,7 @@ extension JSFunction {
254193 }
255194
256195 @discardableResult
257- public func callAsFunction(
196+ override public func callAsFunction(
258197 this: JSObject ,
259198 _ arg0: some ConvertibleToJSValue ,
260199 _ arg1: some ConvertibleToJSValue ,
@@ -273,30 +212,30 @@ extension JSFunction {
273212 }
274213
275214 @discardableResult
276- public func callAsFunction( this: JSObject , arguments: [ JSValue ] ) -> JSValue {
215+ override public func callAsFunction( this: JSObject , arguments: [ JSValue ] ) -> JSValue {
277216 invokeNonThrowingJSFunction ( arguments: arguments, this: this) . jsValue
278217 }
279218
280219 @discardableResult
281- public func callAsFunction( ) -> JSValue {
220+ override public func callAsFunction( ) -> JSValue {
282221 invokeNonThrowingJSFunction ( arguments: [ ] ) . jsValue
283222 }
284223
285224 @discardableResult
286- public func callAsFunction( _ arg0: some ConvertibleToJSValue ) -> JSValue {
225+ override public func callAsFunction( _ arg0: some ConvertibleToJSValue ) -> JSValue {
287226 invokeNonThrowingJSFunction ( arguments: [ arg0. jsValue] ) . jsValue
288227 }
289228
290229 @discardableResult
291- public func callAsFunction(
230+ override public func callAsFunction(
292231 _ arg0: some ConvertibleToJSValue ,
293232 _ arg1: some ConvertibleToJSValue
294233 ) -> JSValue {
295234 invokeNonThrowingJSFunction ( arguments: [ arg0. jsValue, arg1. jsValue] ) . jsValue
296235 }
297236
298237 @discardableResult
299- public func callAsFunction(
238+ override public func callAsFunction(
300239 _ arg0: some ConvertibleToJSValue ,
301240 _ arg1: some ConvertibleToJSValue ,
302241 _ arg2: some ConvertibleToJSValue
@@ -305,7 +244,7 @@ extension JSFunction {
305244 }
306245
307246 @discardableResult
308- public func callAsFunction(
247+ override public func callAsFunction(
309248 _ arg0: some ConvertibleToJSValue ,
310249 _ arg1: some ConvertibleToJSValue ,
311250 _ arg2: some ConvertibleToJSValue ,
@@ -315,7 +254,7 @@ extension JSFunction {
315254 }
316255
317256 @discardableResult
318- public func callAsFunction(
257+ override public func callAsFunction(
319258 _ arg0: some ConvertibleToJSValue ,
320259 _ arg1: some ConvertibleToJSValue ,
321260 _ arg2: some ConvertibleToJSValue ,
@@ -327,7 +266,7 @@ extension JSFunction {
327266 }
328267
329268 @discardableResult
330- public func callAsFunction(
269+ override public func callAsFunction(
331270 _ arg0: some ConvertibleToJSValue ,
332271 _ arg1: some ConvertibleToJSValue ,
333272 _ arg2: some ConvertibleToJSValue ,
@@ -341,7 +280,7 @@ extension JSFunction {
341280 }
342281
343282 @discardableResult
344- public func callAsFunction(
283+ override public func callAsFunction(
345284 _ arg0: some ConvertibleToJSValue ,
346285 _ arg1: some ConvertibleToJSValue ,
347286 _ arg2: some ConvertibleToJSValue ,
@@ -355,30 +294,30 @@ extension JSFunction {
355294 ] ) . jsValue
356295 }
357296
358- public func new( ) -> JSObject {
297+ override public func new( ) -> JSObject {
359298 new ( arguments: [ ] )
360299 }
361300
362- public func new( _ arg0: some ConvertibleToJSValue ) -> JSObject {
301+ override public func new( _ arg0: some ConvertibleToJSValue ) -> JSObject {
363302 new ( arguments: [ arg0. jsValue] )
364303 }
365304
366- public func new(
305+ override public func new(
367306 _ arg0: some ConvertibleToJSValue ,
368307 _ arg1: some ConvertibleToJSValue
369308 ) -> JSObject {
370309 new ( arguments: [ arg0. jsValue, arg1. jsValue] )
371310 }
372311
373- public func new(
312+ override public func new(
374313 _ arg0: some ConvertibleToJSValue ,
375314 _ arg1: some ConvertibleToJSValue ,
376315 _ arg2: some ConvertibleToJSValue
377316 ) -> JSObject {
378317 new ( arguments: [ arg0. jsValue, arg1. jsValue, arg2. jsValue] )
379318 }
380319
381- public func new(
320+ override public func new(
382321 _ arg0: some ConvertibleToJSValue ,
383322 _ arg1: some ConvertibleToJSValue ,
384323 _ arg2: some ConvertibleToJSValue ,
@@ -387,7 +326,7 @@ extension JSFunction {
387326 new ( arguments: [ arg0. jsValue, arg1. jsValue, arg2. jsValue, arg3. jsValue] )
388327 }
389328
390- public func new(
329+ override public func new(
391330 _ arg0: some ConvertibleToJSValue ,
392331 _ arg1: some ConvertibleToJSValue ,
393332 _ arg2: some ConvertibleToJSValue ,
@@ -397,7 +336,7 @@ extension JSFunction {
397336 new ( arguments: [ arg0. jsValue, arg1. jsValue, arg2. jsValue, arg3. jsValue, arg4. jsValue] )
398337 }
399338
400- public func new(
339+ override public func new(
401340 _ arg0: some ConvertibleToJSValue ,
402341 _ arg1: some ConvertibleToJSValue ,
403342 _ arg2: some ConvertibleToJSValue ,
@@ -408,7 +347,7 @@ extension JSFunction {
408347 new ( arguments: [ arg0. jsValue, arg1. jsValue, arg2. jsValue, arg3. jsValue, arg4. jsValue, arg5. jsValue] )
409348 }
410349
411- public func new(
350+ override public func new(
412351 _ arg0: some ConvertibleToJSValue ,
413352 _ arg1: some ConvertibleToJSValue ,
414353 _ arg2: some ConvertibleToJSValue ,
0 commit comments