V8 Project
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 #include "src/v8.h"
7 
8 namespace v8 {
9 namespace internal {
10 
11 
12 const char* const TriggerFailureExtension::kSource =
13  "native function triggerCheckFalse();"
14  "native function triggerAssertFalse();"
15  "native function triggerSlowAssertFalse();";
16 
17 
20  v8::Isolate* isolate,
22  if (strcmp(*v8::String::Utf8Value(str), "triggerCheckFalse") == 0) {
24  isolate,
26  } else if (strcmp(*v8::String::Utf8Value(str), "triggerAssertFalse") == 0) {
28  isolate,
30  } else {
31  CHECK_EQ(0, strcmp(*v8::String::Utf8Value(str), "triggerSlowAssertFalse"));
33  isolate,
35  }
36 }
37 
38 
41  CHECK(false);
42 }
43 
44 
47  DCHECK(false);
48 }
49 
50 
53  SLOW_DCHECK(false);
54 }
55 
56 } } // namespace v8::internal
#define SLOW_DCHECK(condition)
Definition: checks.h:30
The argument information given to function call callbacks.
Definition: v8.h:2650
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >(), int length=0)
Creates a function template.
Definition: api.cc:904
An object reference managed by the v8 garbage collector.
Definition: v8.h:198
Isolate represents an isolated instance of the V8 engine.
Definition: v8.h:4356
Converts an object to a UTF-8-encoded character array.
Definition: v8.h:2048
virtual v8::Handle< v8::FunctionTemplate > GetNativeFunctionTemplate(v8::Isolate *isolate, v8::Handle< v8::String > name)
static void TriggerCheckFalse(const v8::FunctionCallbackInfo< v8::Value > &args)
static void TriggerAssertFalse(const v8::FunctionCallbackInfo< v8::Value > &args)
static void TriggerSlowAssertFalse(const v8::FunctionCallbackInfo< v8::Value > &args)
#define CHECK_EQ(expected, value)
Definition: logging.h:169
#define CHECK(condition)
Definition: logging.h:36
#define DCHECK(condition)
Definition: logging.h:205
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20