blob: 13aacd43987437bb67b2187dac84b0eb5e56be86 [file] [log] [blame]
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "include/v8.h"
#include "src/parsing/parse-info.h"
namespace v8 {
class Isolate;
namespace internal {
class Object;
template <typename T>
class Handle;
class Isolate;
namespace test {
class ScriptResource : public v8::String::ExternalOneByteStringResource {
ScriptResource(const char* data, size_t length)
: data_(data), length_(length) {}
~ScriptResource() override = default;
ScriptResource(const ScriptResource&) = delete;
ScriptResource& operator=(const ScriptResource&) = delete;
const char* data() const override { return data_; }
size_t length() const override { return length_; }
const char* data_;
size_t length_;
Handle<String> CreateSource(
Isolate* isolate,
v8::String::ExternalOneByteStringResource* maybe_resource);
Handle<SharedFunctionInfo> CreateSharedFunctionInfo(
Isolate* isolate,
v8::String::ExternalOneByteStringResource* maybe_resource);
std::unique_ptr<ParseInfo> OuterParseInfoForShared(
Isolate* isolate, Handle<SharedFunctionInfo> shared,
UnoptimizedCompileState* state);
} // namespace test
} // namespace internal
} // namespace v8