Skip to content

Commit 511af4d

Browse files
committed
string_bytes: don't use named imports in header
It imports the definition into every source file that includes string_bytes.h, as evidenced by the build suddenly breaking left and right because of missing Handle/Local/String/Value imports.
1 parent 2fc47ab commit 511af4d

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/node.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ using v8::Exception;
9797
using v8::Function;
9898
using v8::FunctionCallbackInfo;
9999
using v8::FunctionTemplate;
100+
using v8::Handle;
100101
using v8::HandleScope;
101102
using v8::HeapStatistics;
102103
using v8::Integer;
103104
using v8::Isolate;
105+
using v8::Local;
104106
using v8::Locker;
105107
using v8::Message;
106108
using v8::Number;
@@ -110,6 +112,7 @@ using v8::Persistent;
110112
using v8::PropertyCallbackInfo;
111113
using v8::ResourceConstraints;
112114
using v8::SetResourceConstraints;
115+
using v8::String;
113116
using v8::ThrowException;
114117
using v8::TryCatch;
115118
using v8::Uint32;

src/node_crypto.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ using v8::Exception;
7272
using v8::False;
7373
using v8::FunctionCallbackInfo;
7474
using v8::FunctionTemplate;
75+
using v8::Handle;
7576
using v8::HandleScope;
7677
using v8::Integer;
7778
using v8::Local;
@@ -80,6 +81,7 @@ using v8::Object;
8081
using v8::Persistent;
8182
using v8::String;
8283
using v8::ThrowException;
84+
using v8::Value;
8385

8486

8587
// Forcibly clear OpenSSL's error stack on return. This stops stale errors

src/string_bytes.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,35 @@
2929

3030
namespace node {
3131

32-
using v8::Handle;
33-
using v8::Local;
34-
using v8::String;
35-
using v8::Value;
36-
3732
class StringBytes {
3833
public:
3934
// Does the string match the encoding? Quick but non-exhaustive.
4035
// Example: a HEX string must have a length that's a multiple of two.
4136
// FIXME(bnoordhuis) IsMaybeValidString()? Naming things is hard...
42-
static bool IsValidString(Handle<String> string, enum encoding enc);
37+
static bool IsValidString(v8::Handle<v8::String> string, enum encoding enc);
4338

4439
// Fast, but can be 2 bytes oversized for Base64, and
4540
// as much as triple UTF-8 strings <= 65536 chars in length
46-
static size_t StorageSize(Handle<Value> val, enum encoding enc);
41+
static size_t StorageSize(v8::Handle<v8::Value> val, enum encoding enc);
4742

4843
// Precise byte count, but slightly slower for Base64 and
4944
// very much slower for UTF-8
50-
static size_t Size(Handle<Value> val, enum encoding enc);
45+
static size_t Size(v8::Handle<v8::Value> val, enum encoding enc);
5146

5247
// Write the bytes from the string or buffer into the char*
5348
// returns the number of bytes written, which will always be
5449
// <= buflen. Use StorageSize/Size first to know how much
5550
// memory to allocate.
5651
static size_t Write(char* buf,
5752
size_t buflen,
58-
Handle<Value> val,
53+
v8::Handle<v8::Value> val,
5954
enum encoding enc,
6055
int* chars_written = NULL);
6156

6257
// Take the bytes in the src, and turn it into a Buffer or String.
63-
static Local<Value> Encode(const char* buf,
64-
size_t buflen,
65-
enum encoding encoding);
58+
static v8::Local<v8::Value> Encode(const char* buf,
59+
size_t buflen,
60+
enum encoding encoding);
6661
};
6762

6863
} // namespace node

src/tls_wrap.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ using v8::Exception;
3434
using v8::Function;
3535
using v8::FunctionCallbackInfo;
3636
using v8::FunctionTemplate;
37+
using v8::Handle;
3738
using v8::HandleScope;
3839
using v8::Integer;
40+
using v8::Local;
3941
using v8::Null;
4042
using v8::Object;
4143
using v8::Persistent;

0 commit comments

Comments
 (0)