@@ -16,7 +16,6 @@ pub(crate) mod utf8;
16
16
17
17
use std:: {
18
18
fmt:: { self , Debug } ,
19
- marker:: PhantomData ,
20
19
os:: raw:: c_void,
21
20
} ;
22
21
@@ -1040,12 +1039,11 @@ impl Object for JsArray {}
1040
1039
/// # Ok(f)
1041
1040
/// # }
1042
1041
/// ```
1043
- pub struct JsFunction < T : Object = JsObject > {
1042
+ pub struct JsFunction {
1044
1043
raw : raw:: Local ,
1045
- marker : PhantomData < T > ,
1046
1044
}
1047
1045
1048
- impl < T : Object > Object for JsFunction < T > { }
1046
+ impl Object for JsFunction { }
1049
1047
1050
1048
// Maximum number of function arguments in V8.
1051
1049
const V8_ARGC_LIMIT : usize = 65535 ;
@@ -1123,7 +1121,6 @@ impl JsFunction {
1123
1121
if let Ok ( raw) = sys:: fun:: new ( cx. env ( ) . to_raw ( ) , name, f) {
1124
1122
Ok ( Handle :: new_internal ( JsFunction {
1125
1123
raw,
1126
- marker : PhantomData ,
1127
1124
} ) )
1128
1125
} else {
1129
1126
Err ( Throw :: new ( ) )
@@ -1132,7 +1129,7 @@ impl JsFunction {
1132
1129
}
1133
1130
}
1134
1131
1135
- impl < CL : Object > JsFunction < CL > {
1132
+ impl JsFunction {
1136
1133
/// Calls this function.
1137
1134
///
1138
1135
/// **See also:** [`JsFunction::call_with`].
@@ -1173,7 +1170,7 @@ impl<CL: Object> JsFunction<CL> {
1173
1170
/// Calls this function as a constructor.
1174
1171
///
1175
1172
/// **See also:** [`JsFunction::construct_with`].
1176
- pub fn construct < ' a , ' b , C : Context < ' a > , AS > ( & self , cx : & mut C , args : AS ) -> JsResult < ' a , CL >
1173
+ pub fn construct < ' a , ' b , C : Context < ' a > , AS > ( & self , cx : & mut C , args : AS ) -> JsResult < ' a , JsObject >
1177
1174
where
1178
1175
AS : AsRef < [ Handle < ' b , JsValue > ] > ,
1179
1176
{
@@ -1216,23 +1213,22 @@ impl JsFunction {
1216
1213
/// The caller must wrap in a `Handle` with an appropriate lifetime.
1217
1214
unsafe fn clone ( & self ) -> Self {
1218
1215
Self {
1219
- marker : PhantomData ,
1220
1216
raw : self . raw ,
1221
1217
}
1222
1218
}
1223
1219
}
1224
1220
1225
- impl < T : Object > Value for JsFunction < T > { }
1221
+ impl Value for JsFunction { }
1226
1222
1227
- unsafe impl < T : Object > TransparentNoCopyWrapper for JsFunction < T > {
1223
+ unsafe impl TransparentNoCopyWrapper for JsFunction {
1228
1224
type Inner = raw:: Local ;
1229
1225
1230
1226
fn into_inner ( self ) -> Self :: Inner {
1231
1227
self . raw
1232
1228
}
1233
1229
}
1234
1230
1235
- impl < T : Object > ValueInternal for JsFunction < T > {
1231
+ impl ValueInternal for JsFunction {
1236
1232
fn name ( ) -> String {
1237
1233
"function" . to_string ( )
1238
1234
}
@@ -1248,7 +1244,6 @@ impl<T: Object> ValueInternal for JsFunction<T> {
1248
1244
unsafe fn from_local ( _env : Env , h : raw:: Local ) -> Self {
1249
1245
JsFunction {
1250
1246
raw : h,
1251
- marker : PhantomData ,
1252
1247
}
1253
1248
}
1254
1249
}
0 commit comments