chromium/v8/test/unittests/parser/decls-unittest.cc

// Copyright 2007-2008 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-external.h"
#include "include/v8-initialization.h"
#include "include/v8-template.h"
#include "src/init/v8.h"
#include "test/unittests/heap/heap-utils.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace v8 {

namespace {

enum Expectations {};

using DeclsTest = TestWithIsolate;

// A DeclarationContext holds a reference to a v8::Context and keeps
// track of various declaration related counters to make it easier to
// track if global declarations in the presence of interceptors behave
// the right way.
class DeclarationContext {};

DeclarationContext::DeclarationContext()
    :{}

void DeclarationContext::InitializeIfNeeded() {}

void DeclarationContext::Check(const char* source, int get, int set, int query,
                               Expectations expectations,
                               v8::Local<Value> value) {}

v8::Intercepted DeclarationContext::HandleGet(
    Local<Name> key, const v8::PropertyCallbackInfo<v8::Value>& info) {}

v8::Intercepted DeclarationContext::HandleSet(
    Local<Name> key, Local<Value> value,
    const v8::PropertyCallbackInfo<void>& info) {}

v8::Intercepted DeclarationContext::HandleQuery(
    Local<Name> key, const v8::PropertyCallbackInfo<v8::Integer>& info) {}

DeclarationContext* DeclarationContext::GetInstance(Local<Value> data) {}

v8::Local<Value> DeclarationContext::Get(Local<Name> key) {}

Maybe<bool> DeclarationContext::Set(Local<Name> key, Local<Value> value) {}

v8::Local<Integer> DeclarationContext::Query(Local<Name> key) {}

}  // namespace

// Test global declaration of a property the interceptor doesn't know
// about and doesn't handle.
TEST_F(DeclsTest, Unknown) {}

class AbsentPropertyContext : public DeclarationContext {};

TEST_F(DeclsTest, Absent) {}

class AppearingPropertyContext : public DeclarationContext {};

TEST_F(DeclsTest, Appearing) {}

class ExistsInPrototypeContext : public DeclarationContext {};

TEST_F(DeclsTest, ExistsInPrototype) {}

class AbsentInPrototypeContext : public DeclarationContext {};

TEST_F(DeclsTest, AbsentInPrototype) {}

class SimpleContext {};

TEST_F(DeclsTest, CrossScriptReferences) {}

TEST_F(DeclsTest, CrossScriptReferences_Simple) {}

TEST_F(DeclsTest, CrossScriptReferences_Simple2) {}

TEST_F(DeclsTest, CrossScriptReferencesHarmony) {}

TEST_F(DeclsTest, CrossScriptReferencesHarmonyRegress) {}

TEST_F(DeclsTest, GlobalLexicalOSR) {}

TEST_F(DeclsTest, CrossScriptConflicts) {}

TEST_F(DeclsTest, CrossScriptDynamicLookup) {}

TEST_F(DeclsTest, CrossScriptGlobal) {}

TEST_F(DeclsTest, CrossScriptStaticLookupUndeclared) {}

TEST_F(DeclsTest, CrossScriptLoadICs) {}

TEST_F(DeclsTest, CrossScriptStoreICs) {}

TEST_F(DeclsTest, CrossScriptAssignmentToConst) {}

TEST_F(DeclsTest, Regress425510) {}

TEST_F(DeclsTest, Regress3941) {}

TEST_F(DeclsTest, Regress3941_Reads) {}

TEST_F(DeclsTest, TestUsing) {}

TEST_F(DeclsTest, TestAwaitUsing) {}

}  // namespace v8