Skip to content

Commit 7c4c796

Browse files
committed
chore: remove reformatting changes
1 parent 655f052 commit 7c4c796

1 file changed

Lines changed: 30 additions & 19 deletions

File tree

src/node_util.cc

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ CHAR_TEST(16, IsUnicodeSurrogate, (ch & 0xF800) == 0xD800)
4949
// If a UTF-16 surrogate is a low/trailing one.
5050
CHAR_TEST(16, IsUnicodeSurrogateTrail, (ch & 0x400) != 0)
5151

52-
static void GetOwnNonIndexProperties(const FunctionCallbackInfo<Value>& args) {
52+
static void GetOwnNonIndexProperties(
53+
const FunctionCallbackInfo<Value>& args) {
5354
Environment* env = Environment::GetCurrent(args);
5455
Local<Context> context = env->context();
5556

@@ -61,20 +62,20 @@ static void GetOwnNonIndexProperties(const FunctionCallbackInfo<Value>& args) {
6162
Local<Array> properties;
6263

6364
PropertyFilter filter =
64-
static_cast<PropertyFilter>(args[1].As<Uint32>()->Value());
65-
66-
if (!object
67-
->GetPropertyNames(context,
68-
KeyCollectionMode::kOwnOnly,
69-
filter,
70-
IndexFilter::kSkipIndices)
71-
.ToLocal(&properties)) {
65+
static_cast<PropertyFilter>(args[1].As<Uint32>()->Value());
66+
67+
if (!object->GetPropertyNames(
68+
context, KeyCollectionMode::kOwnOnly,
69+
filter,
70+
IndexFilter::kSkipIndices)
71+
.ToLocal(&properties)) {
7272
return;
7373
}
7474
args.GetReturnValue().Set(properties);
7575
}
7676

77-
static void GetConstructorName(const FunctionCallbackInfo<Value>& args) {
77+
static void GetConstructorName(
78+
const FunctionCallbackInfo<Value>& args) {
7879
CHECK(args[0]->IsObject());
7980

8081
Local<Object> object = args[0].As<Object>();
@@ -83,7 +84,8 @@ static void GetConstructorName(const FunctionCallbackInfo<Value>& args) {
8384
args.GetReturnValue().Set(name);
8485
}
8586

86-
static void GetExternalValue(const FunctionCallbackInfo<Value>& args) {
87+
static void GetExternalValue(
88+
const FunctionCallbackInfo<Value>& args) {
8789
CHECK(args[0]->IsExternal());
8890
Isolate* isolate = args.GetIsolate();
8991
Local<External> external = args[0].As<External>();
@@ -96,14 +98,15 @@ static void GetExternalValue(const FunctionCallbackInfo<Value>& args) {
9698

9799
static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
98100
// Return undefined if it's not a Promise.
99-
if (!args[0]->IsPromise()) return;
101+
if (!args[0]->IsPromise())
102+
return;
100103

101104
auto isolate = args.GetIsolate();
102105

103106
Local<Promise> promise = args[0].As<Promise>();
104107

105108
int state = promise->State();
106-
Local<Value> values[2] = {Integer::New(isolate, state)};
109+
Local<Value> values[2] = { Integer::New(isolate, state) };
107110
size_t number_of_values = 1;
108111
if (state != Promise::PromiseState::kPending)
109112
values[number_of_values++] = promise->Result();
@@ -113,15 +116,19 @@ static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
113116

114117
static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
115118
// Return undefined if it's not a proxy.
116-
if (!args[0]->IsProxy()) return;
119+
if (!args[0]->IsProxy())
120+
return;
117121

118122
Local<Proxy> proxy = args[0].As<Proxy>();
119123

120124
// TODO(BridgeAR): Remove the length check as soon as we prohibit access to
121125
// the util binding layer. It's accessed in the wild and `esm` would break in
122126
// case the check is removed.
123127
if (args.Length() == 1 || args[1]->IsTrue()) {
124-
Local<Value> ret[] = {proxy->GetTarget(), proxy->GetHandler()};
128+
Local<Value> ret[] = {
129+
proxy->GetTarget(),
130+
proxy->GetHandler()
131+
};
125132

126133
args.GetReturnValue().Set(
127134
Array::New(args.GetIsolate(), ret, arraysize(ret)));
@@ -157,17 +164,22 @@ static void GetCallerLocation(const FunctionCallbackInfo<Value>& args) {
157164
}
158165

159166
static void PreviewEntries(const FunctionCallbackInfo<Value>& args) {
160-
if (!args[0]->IsObject()) return;
167+
if (!args[0]->IsObject())
168+
return;
161169

162170
Environment* env = Environment::GetCurrent(args);
163171
bool is_key_value;
164172
Local<Array> entries;
165173
if (!args[0].As<Object>()->PreviewEntries(&is_key_value).ToLocal(&entries))
166174
return;
167175
// Fast path for WeakMap and WeakSet.
168-
if (args.Length() == 1) return args.GetReturnValue().Set(entries);
176+
if (args.Length() == 1)
177+
return args.GetReturnValue().Set(entries);
169178

170-
Local<Value> ret[] = {entries, Boolean::New(env->isolate(), is_key_value)};
179+
Local<Value> ret[] = {
180+
entries,
181+
Boolean::New(env->isolate(), is_key_value)
182+
};
171183
return args.GetReturnValue().Set(
172184
Array::New(env->isolate(), ret, arraysize(ret)));
173185
}
@@ -213,7 +225,6 @@ static uint32_t GetUVHandleTypeCode(const uv_handle_type type) {
213225

214226
static void GuessHandleType(const FunctionCallbackInfo<Value>& args) {
215227
Environment* env = Environment::GetCurrent(args);
216-
217228
int fd;
218229
if (!args[0]->Int32Value(env->context()).To(&fd)) return;
219230

0 commit comments

Comments
 (0)