
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
25 lines
475 B
C++
25 lines
475 B
C++
/*
|
|
* Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Error.h>
|
|
#include <AK/StringView.h>
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace JS::Bytecode {
|
|
|
|
struct CodeGenerationError {
|
|
ASTNode const* failing_node { nullptr };
|
|
StringView reason_literal;
|
|
|
|
DeprecatedString to_deprecated_string();
|
|
};
|
|
|
|
template<typename T>
|
|
using CodeGenerationErrorOr = ErrorOr<T, CodeGenerationError>;
|
|
|
|
}
|