File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,12 @@ public class JSFunctionRef: JSObjectRef {
33
33
self ( this: this, args: args)
34
34
}
35
35
36
- public func callAsFunction( new arguments: JSValueConvertible ... ) -> JSObjectRef {
37
- arguments. withRawJSValues { rawValues in
36
+ public func callAsFunction( new args: JSValueConvertible ... ) -> JSObjectRef {
37
+ self ( . new, args: args)
38
+ }
39
+
40
+ public func callAsFunction( _: _JSFunctionConstructorSymbol , args: [ JSValueConvertible ] = [ ] ) -> JSObjectRef {
41
+ args. withRawJSValues { rawValues in
38
42
rawValues. withUnsafeBufferPointer { bufferPointer in
39
43
let argv = bufferPointer. baseAddress
40
44
let argc = bufferPointer. count
@@ -47,11 +51,6 @@ public class JSFunctionRef: JSObjectRef {
47
51
}
48
52
}
49
53
}
50
- public func callAsFunction( _: _JSFunctionConstructorSymbol ) -> JSObjectRef {
51
- var resultObj = JavaScriptObjectRef ( )
52
- _call_new ( self . id, nil , 0 , & resultObj)
53
- return JSObjectRef ( id: resultObj)
54
- }
55
54
56
55
@available ( * , unavailable, message: " Please use JSClosure instead " )
57
56
public static func from( _: @escaping ( [ JSValue ] ) -> JSValue ) -> JSFunctionRef {
You can’t perform that action at this time.
0 commit comments