Debian Codegraph @

js/src/irregexp/imported/regexp-error.cc

raw
1 // Copyright 2020 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "irregexp/imported/regexp-error.h"
6
7 namespace v8 {
8 namespace internal {
9
10 const char* const kRegExpErrorStrings[] = {
11 #define TEMPLATE(NAME, STRING) STRING,
12 REGEXP_ERROR_MESSAGES(TEMPLATE)
13 #undef TEMPLATE
14 };
15
16 const char* RegExpErrorString(RegExpError error) {
17 DCHECK_LT(error, RegExpError::NumErrors);
18 return kRegExpErrorStrings[static_cast<int>(error)];
19 }
20
21 } // namespace internal
22 } // namespace v8