chromium/v8/test/cctest/test-accessors.cc

// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
//       copyright notice, this list of conditions and the following
//       disclaimer in the documentation and/or other materials provided
//       with the distribution.
//     * Neither the name of Google Inc. nor the names of its
//       contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <stdlib.h>

#include "include/v8-function.h"
#include "src/api/api-inl.h"
#include "src/execution/frames-inl.h"
#include "src/strings/string-stream.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-utils.h"

ObjectTemplate;
Value;
Context;
Local;
Name;
String;
Script;
Function;
Extension;

static void handle_property(Local<Name> name,
                            const v8::PropertyCallbackInfo<v8::Value>& info) {}

static void handle_property_2(Local<Name> name,
                              const v8::PropertyCallbackInfo<v8::Value>& info) {}

static void handle_property(const v8::FunctionCallbackInfo<v8::Value>& info) {}


THREADED_TEST(PropertyHandler) {}

static void GetIntValue(Local<Name> property,
                        const v8::PropertyCallbackInfo<v8::Value>& info) {}

static void SetIntValue(Local<Name> property, Local<Value> value,
                        const v8::PropertyCallbackInfo<void>& info) {}

int foo, bar, baz;

THREADED_TEST(GlobalVariableAccess) {}

static int x_register[2] =;
static v8::Global<v8::Object> x_receiver_global;
static v8::Global<v8::Object> x_holder_global;

template<class Info>
static void XGetter(const Info& info, int offset) {}

static void XGetter(Local<Name> name,
                    const v8::PropertyCallbackInfo<v8::Value>& info) {}

static void XGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {}

template <typename Info>
Local<v8::Object> GetHolder(const Info& info);

template <>
Local<v8::Object> GetHolder<v8::PropertyCallbackInfo<void>>(
    const v8::PropertyCallbackInfo<void>& info) {}

template <>
Local<v8::Object> GetHolder<v8::FunctionCallbackInfo<v8::Value>>(
    const v8::FunctionCallbackInfo<v8::Value>& info) {}

template<class Info>
static void XSetter(Local<Value> value, const Info& info, int offset) {}

static void XSetter(Local<Name> name, Local<Value> value,
                    const v8::PropertyCallbackInfo<void>& info) {}

static void XSetter(const v8::FunctionCallbackInfo<v8::Value>& info) {}


THREADED_TEST(AccessorIC) {}

template <int C>
static void HandleAllocatingGetter(
    Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(HandleScopePop) {}

// Allow usages of v8::PropertyCallbackInfo<T>::Holder() for now.
// TODO(https://crbug.com/333672197): remove.
START_ALLOW_USE_DEPRECATED()

static void CheckAccessorArgsCorrect(
    Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {}

// Allow usages of v8::PropertyCallbackInfo<T>::Holder() for now.
// TODO(https://crbug.com/333672197): remove.
END_ALLOW_USE_DEPRECATED()

THREADED_TEST(DirectCall) {}

static void EmptyGetter(Local<Name> name,
                        const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(EmptyResult) {}


THREADED_TEST(NoReuseRegress) {}

static void ThrowingGetAccessor(
    Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {}

static void ThrowingSetAccessor(Local<Name> name, Local<Value> value,
                                const v8::PropertyCallbackInfo<void>& info) {}

THREADED_TEST(Regress1054726) {}

static void AllocGetter(Local<Name> name,
                        const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(Gc) {}

static void StackCheck(Local<Name> name,
                       const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(StackIteration) {}

static void AllocateHandles(Local<Name> name,
                            const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(HandleScopeSegment) {}


void JSONStringifyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {}

v8::Intercepted JSONStringifyGetter(
    Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {}

THREADED_TEST(JSONStringifyNamedInterceptorObject) {}

static v8::Global<v8::Context> expected_current_context_global;

static void check_contexts(const v8::FunctionCallbackInfo<v8::Value>& info) {}


THREADED_TEST(AccessorPropertyCrossContext) {}


THREADED_TEST(GlobalObjectAccessor) {}

namespace {
v8::Intercepted EmptyGenericGetter(
    Local<Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {}

void OneProperty(Local<Name> name,
                 const v8::PropertyCallbackInfo<v8::Value>& info) {}
}  // namespace

THREADED_TEST(Regress433458) {}


static bool security_check_value =;

static bool SecurityTestCallback(Local<v8::Context> accessing_context,
                                 Local<v8::Object> accessed_object,
                                 Local<v8::Value> data) {}


TEST(PrototypeGetterAccessCheck) {}

static void CheckReceiver(Local<Name> name,
                          const v8::PropertyCallbackInfo<v8::Value>& info) {}

TEST(Regress609134) {}

TEST(ObjectSetLazyDataProperty) {}

TEST(ObjectSetLazyDataPropertyForIndex) {}

TEST(ObjectTemplateSetLazyPropertySurvivesIC) {}