Skip to content

Commit

Permalink
src: remove long-deprecated APIs without Isolate* arg
Browse files Browse the repository at this point in the history
These have been deprecated since 75adde0
(February 2014) and most likely do not see much ecosystem usage
to begin with.

PR-URL: #23178
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax committed Oct 4, 2018
1 parent 8bf48bf commit 3d21245
Showing 1 changed file with 0 additions and 52 deletions.
52 changes: 0 additions & 52 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,21 +390,10 @@ NODE_EXTERN enum encoding ParseEncoding(
v8::Isolate* isolate,
v8::Local<v8::Value> encoding_v,
enum encoding default_encoding = LATIN1);
NODE_DEPRECATED("Use ParseEncoding(isolate, ...)",
inline enum encoding ParseEncoding(
v8::Local<v8::Value> encoding_v,
enum encoding default_encoding = LATIN1) {
return ParseEncoding(v8::Isolate::GetCurrent(), encoding_v, default_encoding);
})

NODE_EXTERN void FatalException(v8::Isolate* isolate,
const v8::TryCatch& try_catch);

NODE_DEPRECATED("Use FatalException(isolate, ...)",
inline void FatalException(const v8::TryCatch& try_catch) {
return FatalException(v8::Isolate::GetCurrent(), try_catch);
})

NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
const char* buf,
size_t len,
Expand All @@ -416,64 +405,23 @@ NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
const uint16_t* buf,
size_t len);

NODE_DEPRECATED("Use Encode(isolate, ...)",
inline v8::Local<v8::Value> Encode(
const void* buf,
size_t len,
enum encoding encoding = LATIN1) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
if (encoding == UCS2) {
assert(reinterpret_cast<uintptr_t>(buf) % sizeof(uint16_t) == 0 &&
"UCS2 buffer must be aligned on two-byte boundary.");
const uint16_t* that = static_cast<const uint16_t*>(buf);
return Encode(isolate, that, len / sizeof(*that));
}
return Encode(isolate, static_cast<const char*>(buf), len, encoding);
})

// Returns -1 if the handle was not valid for decoding
NODE_EXTERN ssize_t DecodeBytes(v8::Isolate* isolate,
v8::Local<v8::Value>,
enum encoding encoding = LATIN1);
NODE_DEPRECATED("Use DecodeBytes(isolate, ...)",
inline ssize_t DecodeBytes(
v8::Local<v8::Value> val,
enum encoding encoding = LATIN1) {
return DecodeBytes(v8::Isolate::GetCurrent(), val, encoding);
})

// returns bytes written.
NODE_EXTERN ssize_t DecodeWrite(v8::Isolate* isolate,
char* buf,
size_t buflen,
v8::Local<v8::Value>,
enum encoding encoding = LATIN1);
NODE_DEPRECATED("Use DecodeWrite(isolate, ...)",
inline ssize_t DecodeWrite(char* buf,
size_t buflen,
v8::Local<v8::Value> val,
enum encoding encoding = LATIN1) {
return DecodeWrite(v8::Isolate::GetCurrent(), buf, buflen, val, encoding);
})

#ifdef _WIN32
NODE_EXTERN v8::Local<v8::Value> WinapiErrnoException(
v8::Isolate* isolate,
int errorno,
const char* syscall = nullptr,
const char* msg = "",
const char* path = nullptr);

NODE_DEPRECATED("Use WinapiErrnoException(isolate, ...)",
inline v8::Local<v8::Value> WinapiErrnoException(int errorno,
const char* syscall = nullptr, const char* msg = "",
const char* path = nullptr) {
return WinapiErrnoException(v8::Isolate::GetCurrent(),
errorno,
syscall,
msg,
path);
})
#endif

const char* signo_string(int errorno);
Expand Down

0 comments on commit 3d21245

Please sign in to comment.