Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-08-31 11:00:24 +0300
committerDaniel Bevenius <daniel.bevenius@gmail.com>2017-09-03 07:35:53 +0300
commitc7c9e20ed06e62377910d728b60519cdc55b9041 (patch)
treee39c94956bc262de2366bdd396c236ec2dcb3756 /src/node_perf.cc
parent08984b26d351614fe4af0f582acb53c9b43dfda1 (diff)
src: fix compiler warnings in node_perf.cc
Currently, there are a few compiler warnings generated from node_perf.cc regarding unused return values: ../src/node_perf.cc:58:3: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] env->performance_entry_callback()->Call(context, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ../src/node_perf.cc:293:5: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] obj->Set(context, idx, args[idx]); ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ../src/node_perf.cc:373:3: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] target->DefineOwnProperty(context, ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ../src/node_perf.cc:378:3: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result] target->DefineOwnProperty(context, ^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ This commit add checks/casts to avoid the warnings. PR-URL: https://github.com/nodejs/node/pull/15112 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_perf.cc')
-rw-r--r--src/node_perf.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node_perf.cc b/src/node_perf.cc
index a708877d5de..48917d5d4ea 100644
--- a/src/node_perf.cc
+++ b/src/node_perf.cc
@@ -57,7 +57,7 @@ void PerformanceEntry::NotifyObservers(Environment* env,
Local<Value> argv = entry->object();
env->performance_entry_callback()->Call(context,
v8::Undefined(isolate),
- 1, &argv);
+ 1, &argv).ToLocalChecked();
}
void Mark(const FunctionCallbackInfo<Value>& args) {
@@ -290,7 +290,7 @@ void TimerFunctionCall(const FunctionCallbackInfo<Value>& args) {
v8::MaybeLocal<Object> instance = ctor->NewInstance(context);
Local<Object> obj = instance.ToLocalChecked();
for (idx = 0; idx < count; idx++) {
- obj->Set(context, idx, args[idx]);
+ obj->Set(context, idx, args[idx]).ToChecked();
}
new PerformanceEntry(env, obj, *name, "function", start, end);
}
@@ -373,12 +373,12 @@ void Init(Local<Object> target,
target->DefineOwnProperty(context,
FIXED_ONE_BYTE_STRING(isolate, "timeOrigin"),
v8::Number::New(isolate, timeOrigin / 1e6),
- attr);
+ attr).ToChecked();
target->DefineOwnProperty(context,
env->constants_string(),
constants,
- attr);
+ attr).ToChecked();
SetupGarbageCollectionTracking(isolate);
}