Skip to content

Truly independent web browser

909 B
Raw Blame
/*
 * Copyright (c) 2021-2023, Andreas Kling <[email protected]>
 * Copyright (c) 2022, David Tuin <[email protected]>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/NonnullRefPtr.h>
#include <AK/Result.h>
#include <AK/StringView.h>
#include <AK/Utf16View.h>
#include <LibJS/CyclicModule.h>
#include <LibJS/Export.h>
#include <LibJS/Forward.h>
#include <LibJS/ParserError.h>
#include <LibJS/Runtime/ExecutionContext.h>
#include <LibJS/SourceCode.h>

namespace JS {

// 16.2.1.6 Source Text Module Records, https://tc39.es/ecma262/#sec-source-text-module-records
class JS_API SourceTextModule final : public CyclicModule {
public:
    static Result<GC::Ref<SourceTextModule>, Vector<ParserError>> parse(Utf16View source_text, Realm&, StringView filename = {}, Utf16View display_filename = {}, GC::Ptr<GC::Cell> host_defined = nullptr, size_t line_number_offset = 0);
};

}