Store parser errors, source range filenames, source code filenames, module source, and Rust parser errors as UTF-16 where they flow back into JavaScript-visible strings. Keep byte-oriented source buffers byte-backed. Remove temporary PrimitiveString, ByteString, and UTF-8 detours from JSON, RegExp, module debug logging, print formatting, and tests.
26 lines
518 B
C++
26 lines
518 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <AK/RefPtr.h>
|
|
#include <AK/Types.h>
|
|
#include <LibJS/Export.h>
|
|
#include <LibJS/Position.h>
|
|
#include <LibJS/SourceCode.h>
|
|
|
|
namespace JS {
|
|
|
|
struct JS_API SourceRange {
|
|
NonnullRefPtr<SourceCode const> code;
|
|
Position start;
|
|
|
|
Utf16String const& filename() const { return code->filename(); }
|
|
};
|
|
|
|
}
|