v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
trigger-failure-extension.cc
Go to the documentation of this file.
1// Copyright 2013 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
8#include "src/base/logging.h"
9#include "src/common/checks.h"
10
11namespace v8 {
12namespace internal {
13
14
15const char* const TriggerFailureExtension::kSource =
16 "native function triggerCheckFalse();"
17 "native function triggerAssertFalse();"
18 "native function triggerSlowAssertFalse();";
19
20
24 if (strcmp(*v8::String::Utf8Value(isolate, str), "triggerCheckFalse") == 0) {
26 isolate,
28 } else if (strcmp(*v8::String::Utf8Value(isolate, str),
29 "triggerAssertFalse") == 0) {
31 isolate,
33 } else {
34 CHECK_EQ(0, strcmp(*v8::String::Utf8Value(isolate, str),
35 "triggerSlowAssertFalse"));
37 isolate,
39 }
40}
41
46
51
56
57} // namespace internal
58} // namespace v8
#define SLOW_DCHECK(condition)
Definition checks.h:21
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const CFunction *c_function=nullptr, uint16_t instance_type=0, uint16_t allowed_receiver_instance_type_range_start=0, uint16_t allowed_receiver_instance_type_range_end=0)
Definition api.cc:1101
v8::Local< v8::FunctionTemplate > GetNativeFunctionTemplate(v8::Isolate *isolate, v8::Local< v8::String > name) override
static void TriggerSlowAssertFalse(const v8::FunctionCallbackInfo< v8::Value > &info)
static void TriggerCheckFalse(const v8::FunctionCallbackInfo< v8::Value > &info)
static void TriggerAssertFalse(const v8::FunctionCallbackInfo< v8::Value > &info)
#define CHECK(condition)
Definition logging.h:124
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
Definition logging.h:482