chromium/v8/test/cctest/test-api-stack-traces.cc

// Copyright 2019 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 "include/v8-function.h"
#include "src/api/api-inl.h"
#include "src/base/strings.h"
#include "test/cctest/test-api.h"

Array;
Context;
Local;
ObjectTemplate;
String;
TryCatch;
Value;

static v8::MaybeLocal<Value> PrepareStackTrace42(v8::Local<Context> context,
                                                 v8::Local<Value> error,
                                                 v8::Local<Array> trace) {}

static v8::MaybeLocal<Value> PrepareStackTraceThrow(v8::Local<Context> context,
                                                    v8::Local<Value> error,
                                                    v8::Local<Array> trace) {}

THREADED_TEST(IsolatePrepareStackTrace) {}

THREADED_TEST(IsolatePrepareStackTraceThrow) {}

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

THREADED_TEST(ExceptionCreateMessage) {}

// TODO(szuend): Re-enable as a threaded test once investigated and fixed.
// THREADED_TEST(StackTrace) {
TEST(StackTrace) {}

// Checks that a StackFrame has certain expected values.
static void checkStackFrame(const char* expected_script_name,
                            const char* expected_script_source,
                            const char* expected_script_source_mapping_url,
                            const char* expected_func_name,
                            int expected_line_number, int expected_column,
                            bool is_eval, bool is_constructor,
                            v8::Local<v8::StackFrame> frame) {}

// Tests the C++ StackTrace API.

// Test getting OVERVIEW information. Should ignore information that is not
// script name, function name, line number, and column offset.
const char* overview_source_eval =;
const char* overview_source =;

// Test getting DETAILED information.
const char* detailed_source =;

// Test using function.name and function.displayName in stack trace
const char function_name_source[] =;

// Maybe it's a bit pathological to depend on the exact format of the wrapper
// the Function constructor puts around it's input string. If this becomes a
// hassle, maybe come up with some regex matching approach?
const char function_name_source_anon3[] =;
const char function_name_source_anon4[] =;
const char function_name_source_anon5[] =;

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

THREADED_TEST(CaptureStackTrace) {}

static int report_count =;

// Test uncaught exception
const char uncaught_exception_source[] =;

static void StackTraceForUncaughtExceptionListener(
    v8::Local<v8::Message> message, v8::Local<Value>) {}

TEST(CaptureStackTraceForUncaughtException) {}

// Test uncaught exception in a setter
const char uncaught_setter_exception_source[] =;

static void StackTraceForUncaughtExceptionAndSettersListener(
    v8::Local<v8::Message> message, v8::Local<Value> value) {}

TEST(CaptureStackTraceForUncaughtExceptionAndSetters) {}

const char functions_with_function_name[] =;

const char functions_with_function_name_caller[] =;

static void StackTraceFunctionNameListener(v8::Local<v8::Message> message,
                                           v8::Local<Value>) {}

TEST(GetStackTraceContainsFunctionsWithFunctionName) {}

static void RethrowStackTraceHandler(v8::Local<v8::Message> message,
                                     v8::Local<v8::Value> data) {}

// Test that we only return the stack trace at the site where the exception
// is first thrown (not where it is rethrown).
TEST(RethrowStackTrace) {}

static void RethrowPrimitiveStackTraceHandler(v8::Local<v8::Message> message,
                                              v8::Local<v8::Value> data) {}

// Test that we do not recognize identity for primitive exceptions.
TEST(RethrowPrimitiveStackTrace) {}

static void RethrowExistingStackTraceHandler(v8::Local<v8::Message> message,
                                             v8::Local<v8::Value> data) {}

// Test that the stack trace is captured when the error object is created and
// not where it is thrown.
TEST(RethrowExistingStackTrace) {}

static void RethrowBogusErrorStackTraceHandler(v8::Local<v8::Message> message,
                                               v8::Local<v8::Value> data) {}

// Test that the stack trace is captured where the bogus Error object is created
// and not where it is thrown.
TEST(RethrowBogusErrorStackTrace) {}

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

TEST(SourceURLInStackTrace) {}

static int scriptIdInStack[2];

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

TEST(ScriptIdInStackTrace) {}

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

TEST(InlineScriptWithSourceURLInStackTrace) {}

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

TEST(DynamicWithSourceURLInStackTrace) {}

TEST(DynamicWithSourceURLInStackTraceString) {}

UNINITIALIZED_TEST(CaptureStackTraceForStackOverflow) {}

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

TEST(CurrentScriptNameOrSourceURL_Name) {}

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

TEST(CurrentScriptNameOrSourceURL_SourceURL) {}