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 "src/regexp/regexp-error.h" 6 7namespace v8 { 8namespace internal { 9 10const char* const kRegExpErrorStrings[] = { 11#define TEMPLATE(NAME, STRING) STRING, 12 REGEXP_ERROR_MESSAGES(TEMPLATE) 13#undef TEMPLATE 14}; 15 16const 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 23