Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: remove deprecated stuff but keep infra #572

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions doc/property_descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,6 @@ Napi::PropertyDescriptor::PropertyDescriptor (napi_property_descriptor desc);

### Accessor

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (___ name,
Getter getter,
napi_property_attributes attributes = napi_default,
void *data = nullptr);
```

* `[in] name`: The name used for the getter function.
* `[in] getter`: A getter function.
* `[in] attributes`: Potential attributes for the getter function.
* `[in] data`: A pointer to data of any type, default is a null pointer.

Returns a PropertyDescriptor that contains a function.

The name of the property can be any of the following types:
- `const char*`
- `const std::string &`
- `napi_value value`
- `Napi::Name`

**This signature is deprecated. It will result in a memory leak if used.**

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (
Napi::Env env,
Expand All @@ -109,30 +87,6 @@ The name of the property can be any of the following types:
- `const std::string &`
- `Napi::Name`

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (___ name,
Getter getter,
Setter setter,
napi_property_attributes attributes = napi_default,
void *data = nullptr);
```

* `[in] name`: The name of the getter and setter function.
* `[in] getter`: The getter function.
* `[in] setter`: The setter function.
* `[in] attributes`: Potential attributes for the getter function.
* `[in] data`: A pointer to data of any type, default is a null pointer.

Returns a `Napi::PropertyDescriptor` that contains a `Getter` and `Setter` function.

The name of the property can be any of the following types:
- `const char*`
- `const std::string &`
- `napi_value value`
- `Napi::Name`

**This signature is deprecated. It will result in a memory leak if used.**

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Accessor (
Napi::Env env,
Expand Down Expand Up @@ -161,28 +115,6 @@ The name of the property can be any of the following types:

### Function

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Function (___ name,
Callable cb,
napi_property_attributes attributes = napi_default,
void *data = nullptr);
```

* `[in] name`: The name of the Callable function.
* `[in] cb`: The function
* `[in] attributes`: Potential attributes for the getter function.
* `[in] data`: A pointer to data of any type, default is a null pointer.

Returns a `Napi::PropertyDescriptor` that contains a callable `Napi::Function`.

The name of the property can be any of the following types:
- `const char*`
- `const std::string &`
- `napi_value value`
- `Napi::Name`

**This signature is deprecated. It will result in a memory leak if used.**

```cpp
static Napi::PropertyDescriptor Napi::PropertyDescriptor::Function (
Napi::Env env,
Expand Down
192 changes: 0 additions & 192 deletions napi-inl.deprecated.h

This file was deleted.

4 changes: 0 additions & 4 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ struct AccessorCallbackData {

} // namespace details

#ifndef NODE_ADDON_API_DISABLE_DEPRECATED
# include "napi-inl.deprecated.h"
#endif // !NODE_ADDON_API_DISABLE_DEPRECATED

////////////////////////////////////////////////////////////////////////////////
// Module registration
////////////////////////////////////////////////////////////////////////////////
Expand Down
66 changes: 0 additions & 66 deletions napi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1401,72 +1401,6 @@ namespace Napi {

class PropertyDescriptor {
public:
#ifndef NODE_ADDON_API_DISABLE_DEPRECATED
template <typename Getter>
static PropertyDescriptor Accessor(const char* utf8name,
Getter getter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter>
static PropertyDescriptor Accessor(const std::string& utf8name,
Getter getter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter>
static PropertyDescriptor Accessor(napi_value name,
Getter getter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter>
static PropertyDescriptor Accessor(Name name,
Getter getter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter, typename Setter>
static PropertyDescriptor Accessor(const char* utf8name,
Getter getter,
Setter setter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter, typename Setter>
static PropertyDescriptor Accessor(const std::string& utf8name,
Getter getter,
Setter setter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter, typename Setter>
static PropertyDescriptor Accessor(napi_value name,
Getter getter,
Setter setter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Getter, typename Setter>
static PropertyDescriptor Accessor(Name name,
Getter getter,
Setter setter,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Callable>
static PropertyDescriptor Function(const char* utf8name,
Callable cb,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Callable>
static PropertyDescriptor Function(const std::string& utf8name,
Callable cb,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Callable>
static PropertyDescriptor Function(napi_value name,
Callable cb,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
template <typename Callable>
static PropertyDescriptor Function(Name name,
Callable cb,
napi_property_attributes attributes = napi_default,
void* data = nullptr);
#endif // !NODE_ADDON_API_DISABLE_DEPRECATED

template <typename Getter>
static PropertyDescriptor Accessor(Napi::Env env,
Expand Down
6 changes: 0 additions & 6 deletions test/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ Object InitHandleScope(Env env);
Object InitMemoryManagement(Env env);
Object InitName(Env env);
Object InitObject(Env env);
#ifndef NODE_ADDON_API_DISABLE_DEPRECATED
Object InitObjectDeprecated(Env env);
#endif // !NODE_ADDON_API_DISABLE_DEPRECATED
Object InitPromise(Env env);
#if (NAPI_VERSION > 3)
Object InitThreadSafeFunctionPtr(Env env);
Expand Down Expand Up @@ -78,9 +75,6 @@ Object Init(Env env, Object exports) {
exports.Set("handlescope", InitHandleScope(env));
exports.Set("memory_management", InitMemoryManagement(env));
exports.Set("object", InitObject(env));
#ifndef NODE_ADDON_API_DISABLE_DEPRECATED
exports.Set("object_deprecated", InitObjectDeprecated(env));
#endif // !NODE_ADDON_API_DISABLE_DEPRECATED
exports.Set("promise", InitPromise(env));
#if (NAPI_VERSION > 3)
exports.Set("threadsafe_function_ptr", InitThreadSafeFunctionPtr(env));
Expand Down
6 changes: 3 additions & 3 deletions test/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
['NAPI_VERSION!=""', { 'defines': ['NAPI_VERSION=<@(NAPI_VERSION)'] } ],
['disable_deprecated=="true"', {
'defines': ['NODE_ADDON_API_DISABLE_DEPRECATED']
}, {
'sources': ['object/object_deprecated.cc']
}],
}
# Otherwise, {'sources':[source files testing deprecated features] }
],
['OS=="mac"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
Expand Down
Loading