0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/deps/v8/tools/collect_deprecation_stats.sh
Michaël Zasso 586db2414a
deps: update V8 to 6.9.427.22
PR-URL: https://github.com/nodejs/node/pull/21983
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-09-07 20:59:13 +02:00

36 lines
864 B
Bash
Executable File

#!/bin/bash
# Collect the number of [[deprecated]] calls detected when compiling V8.
# Requires "v8_deprecate_get_isolate = true" to be useful.
set -e
if [ -z "$1" ]; then
(>&2 echo "Usage: collect_deprecation_stats.sh [<outdir>|<log>]")
exit 1
fi
if [ -d "$1" ]; then
OUTDIR=$1
FULL_LOG=/tmp/get_isolate_deprecation.log
gn clean "$OUTDIR"
autoninja -C "$OUTDIR" > $FULL_LOG
else
FULL_LOG=$1
fi
FILTERED_LOG=/tmp/filtered_isolate_deprecation.log
UNIQUE_WARNINGS_LOG=/tmp/unique_warnings.log
grep "warning:" "$FULL_LOG" | sed $'
s|^\.\./\.\./||;
s/: warning: \'/: /;
# strip everything after deprecated function name (including template param).
s/\(<.*>\)\\?\'.*//' > $FILTERED_LOG
sort -u $FILTERED_LOG > $UNIQUE_WARNINGS_LOG
echo "Total deprecated calls: $(wc -l < $UNIQUE_WARNINGS_LOG)"
cut -f2 -d' ' $UNIQUE_WARNINGS_LOG | sort | uniq -c