chromium/v8/include/v8-primitive.h

// Copyright 2021 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.

#ifndef INCLUDE_V8_PRIMITIVE_H_
#define INCLUDE_V8_PRIMITIVE_H_

#include "v8-data.h"          // NOLINT(build/include_directory)
#include "v8-internal.h"      // NOLINT(build/include_directory)
#include "v8-local-handle.h"  // NOLINT(build/include_directory)
#include "v8-value.h"         // NOLINT(build/include_directory)
#include "v8config.h"         // NOLINT(build/include_directory)

namespace v8 {

class Context;
class Isolate;
class String;

namespace internal {
class ExternalString;
class ScopedExternalStringLock;
class StringForwardingTable;
}  // namespace internal

/**
 * The superclass of primitive values.  See ECMA-262 4.3.2.
 */
class V8_EXPORT Primitive : public Value {};

/**
 * A primitive boolean value (ECMA-262, 4.3.14).  Either the true
 * or false value.
 */
class V8_EXPORT Boolean : public Primitive {};

/**
 * An array to hold Primitive values. This is used by the embedder to
 * pass host defined options to the ScriptOptions during compilation.
 *
 * This is passed back to the embedder as part of
 * HostImportModuleDynamicallyCallback for module loading.
 */
class V8_EXPORT PrimitiveArray : public Data {};

/**
 * A superclass for symbols and strings.
 */
class V8_EXPORT Name : public Primitive {};

/**
 * A flag describing different modes of string creation.
 *
 * Aside from performance implications there are no differences between the two
 * creation modes.
 */
enum class NewStringType {};

/**
 * A JavaScript string value (ECMA-262, 4.3.17).
 */
class V8_EXPORT String : public Name {};

// Zero-length string specialization (templated string size includes
// terminator).
template <>
inline V8_WARN_UNUSED_RESULT Local<String> String::NewFromUtf8Literal(
    Isolate* isolate, const char (&literal)[1], NewStringType type) {}

/**
 * Interface for iterating through all external resources in the heap.
 */
class V8_EXPORT ExternalResourceVisitor {};

/**
 * A JavaScript symbol (ECMA-262 edition 6)
 */
class V8_EXPORT Symbol : public Name {};

/**
 * A JavaScript numeric value (either Number or BigInt).
 * https://tc39.es/ecma262/#sec-numeric-types
 */
class V8_EXPORT Numeric : public Primitive {};

/**
 * A JavaScript number value (ECMA-262, 4.3.20)
 */
class V8_EXPORT Number : public Numeric {};

/**
 * A JavaScript value representing a signed integer.
 */
class V8_EXPORT Integer : public Number {};

/**
 * A JavaScript value representing a 32-bit signed integer.
 */
class V8_EXPORT Int32 : public Integer {};

/**
 * A JavaScript value representing a 32-bit unsigned integer.
 */
class V8_EXPORT Uint32 : public Integer {};

/**
 * A JavaScript BigInt value (https://tc39.github.io/proposal-bigint)
 */
class V8_EXPORT BigInt : public Numeric {};

Local<String> String::Empty(Isolate* isolate) {}

String::ExternalStringResource* String::GetExternalStringResource() const {}

String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
    v8::Isolate* isolate, String::Encoding* encoding_out) const {}

String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
    String::Encoding* encoding_out) const {}

// --- Statics ---

V8_INLINE Local<Primitive> Undefined(Isolate* isolate) {}

V8_INLINE Local<Primitive> Null(Isolate* isolate) {}

V8_INLINE Local<Boolean> True(Isolate* isolate) {}

V8_INLINE Local<Boolean> False(Isolate* isolate) {}

Local<Boolean> Boolean::New(Isolate* isolate, bool value) {}

}  // namespace v8

#endif  // INCLUDE_V8_PRIMITIVE_H_