node/deps/v8/tools/find-builtin
Michaël Zasso a7cbf19a82
deps: update V8 to 9.1.269.36
PR-URL: https://github.com/nodejs/node/pull/38273
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-06-10 11:10:13 +02:00

24 lines
628 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
BUILTIN_NAME="$1"
if ! which rg >/dev/null ; then
echo >&2 "This tool requires 'rg', install it with 'sudo apt install ripgrep'"
exit 1
fi
TOOLS_DIRNAME="$(dirname "$0")"
V8_DIRNAME="$(dirname "$TOOLS_DIRNAME")"
if rg --type-add 'tq:*.tq' --type tq --with-filename --line-number "\bbuiltin $BUILTIN_NAME\b" "$V8_DIRNAME" | rg -v '\bextern builtin\b' | cut -f1-2 -d: ; then
exit 0
fi
if rg --type cpp --with-filename --line-number "\b(TF_BUILTIN\(|::Generate_?)$BUILTIN_NAME\b" "$V8_DIRNAME" | cut -f1-2 -d: ; then
exit 0
fi
echo >&2 "Builtin '$BUILTIN_NAME' not found"
exit 1