@@ -1236,66 +1236,86 @@ namespace Napi {
1236
1236
class PropertyDescriptor {
1237
1237
public:
1238
1238
template <typename Getter>
1239
- static PropertyDescriptor Accessor (const char * utf8name,
1239
+ static PropertyDescriptor Accessor (Napi::Env env,
1240
+ Napi::Object destination,
1241
+ const char * utf8name,
1240
1242
Getter getter,
1241
1243
napi_property_attributes attributes = napi_default,
1242
1244
void * data = nullptr );
1243
1245
template <typename Getter>
1244
- static PropertyDescriptor Accessor (const std::string& utf8name,
1246
+ static PropertyDescriptor Accessor (Napi::Env env,
1247
+ Napi::Object destination,
1248
+ const std::string& utf8name,
1245
1249
Getter getter,
1246
1250
napi_property_attributes attributes = napi_default,
1247
1251
void * data = nullptr );
1248
1252
template <typename Getter>
1249
- static PropertyDescriptor Accessor (napi_value name,
1253
+ static PropertyDescriptor Accessor (Napi::Env env,
1254
+ Napi::Object destination,
1255
+ napi_value name,
1250
1256
Getter getter,
1251
1257
napi_property_attributes attributes = napi_default,
1252
1258
void * data = nullptr );
1253
1259
template <typename Getter>
1254
- static PropertyDescriptor Accessor (Name name,
1260
+ static PropertyDescriptor Accessor (Napi::Env env,
1261
+ Napi::Object destination,
1262
+ Name name,
1255
1263
Getter getter,
1256
1264
napi_property_attributes attributes = napi_default,
1257
1265
void * data = nullptr );
1258
1266
template <typename Getter, typename Setter>
1259
- static PropertyDescriptor Accessor (const char * utf8name,
1267
+ static PropertyDescriptor Accessor (Napi::Env env,
1268
+ Napi::Object destination,
1269
+ const char * utf8name,
1260
1270
Getter getter,
1261
1271
Setter setter,
1262
1272
napi_property_attributes attributes = napi_default,
1263
1273
void * data = nullptr );
1264
1274
template <typename Getter, typename Setter>
1265
- static PropertyDescriptor Accessor (const std::string& utf8name,
1275
+ static PropertyDescriptor Accessor (Napi::Env env,
1276
+ Napi::Object destination,
1277
+ const std::string& utf8name,
1266
1278
Getter getter,
1267
1279
Setter setter,
1268
1280
napi_property_attributes attributes = napi_default,
1269
1281
void * data = nullptr );
1270
1282
template <typename Getter, typename Setter>
1271
- static PropertyDescriptor Accessor (napi_value name,
1283
+ static PropertyDescriptor Accessor (Napi::Env env,
1284
+ Napi::Object destination,
1285
+ napi_value name,
1272
1286
Getter getter,
1273
1287
Setter setter,
1274
1288
napi_property_attributes attributes = napi_default,
1275
1289
void * data = nullptr );
1276
1290
template <typename Getter, typename Setter>
1277
- static PropertyDescriptor Accessor (Name name,
1291
+ static PropertyDescriptor Accessor (Napi::Env env,
1292
+ Napi::Object destination,
1293
+ Name name,
1278
1294
Getter getter,
1279
1295
Setter setter,
1280
1296
napi_property_attributes attributes = napi_default,
1281
1297
void * data = nullptr );
1282
1298
template <typename Callable>
1283
- static PropertyDescriptor Function (const char * utf8name,
1299
+ static PropertyDescriptor Function (Napi::Env env,
1300
+ const char * utf8name,
1284
1301
Callable cb,
1285
1302
napi_property_attributes attributes = napi_default,
1286
1303
void * data = nullptr );
1287
1304
template <typename Callable>
1288
- static PropertyDescriptor Function (const std::string& utf8name,
1305
+ static PropertyDescriptor Function (Napi::Env env,
1306
+ const std::string& utf8name,
1289
1307
Callable cb,
1290
1308
napi_property_attributes attributes = napi_default,
1291
1309
void * data = nullptr );
1292
1310
template <typename Callable>
1293
- static PropertyDescriptor Function (napi_value name,
1311
+ static PropertyDescriptor Function (Napi::Env env,
1312
+ napi_value name,
1294
1313
Callable cb,
1295
1314
napi_property_attributes attributes = napi_default,
1296
1315
void * data = nullptr );
1297
1316
template <typename Callable>
1298
- static PropertyDescriptor Function (Name name,
1317
+ static PropertyDescriptor Function (Napi::Env env,
1318
+ Name name,
1299
1319
Callable cb,
1300
1320
napi_property_attributes attributes = napi_default,
1301
1321
void * data = nullptr );
@@ -1390,11 +1410,13 @@ namespace Napi {
1390
1410
const char * utf8name,
1391
1411
const std::vector<PropertyDescriptor>& properties,
1392
1412
void * data = nullptr );
1393
- static PropertyDescriptor StaticMethod (const char * utf8name,
1413
+ static PropertyDescriptor StaticMethod (Napi::Env env,
1414
+ const char * utf8name,
1394
1415
StaticVoidMethodCallback method,
1395
1416
napi_property_attributes attributes = napi_default,
1396
1417
void * data = nullptr );
1397
- static PropertyDescriptor StaticMethod (const char * utf8name,
1418
+ static PropertyDescriptor StaticMethod (Napi::Env env,
1419
+ const char * utf8name,
1398
1420
StaticMethodCallback method,
1399
1421
napi_property_attributes attributes = napi_default,
1400
1422
void * data = nullptr );
@@ -1442,6 +1464,11 @@ namespace Napi {
1442
1464
static napi_value InstanceGetterCallbackWrapper (napi_env env, napi_callback_info info);
1443
1465
static napi_value InstanceSetterCallbackWrapper (napi_env env, napi_callback_info info);
1444
1466
static void FinalizeCallback (napi_env env, void * data, void * hint);
1467
+ static Function DefineClass (napi_env env,
1468
+ const char * utf8name,
1469
+ size_t count,
1470
+ const napi_property_descriptor* desc,
1471
+ void * data);
1445
1472
1446
1473
template <typename TCallback>
1447
1474
struct MethodCallbackData {
0 commit comments