v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8-value-utils.cc
Go to the documentation of this file.
1
// Copyright 2016 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
5
#include "
src/inspector/v8-value-utils.h
"
6
7
#include "
include/v8-container.h
"
8
#include "
include/v8-context.h
"
9
#include "
include/v8-exception.h
"
10
11
namespace
v8_inspector
{
12
13
v8::Maybe<bool>
createDataProperty
(
v8::Local<v8::Context>
context,
14
v8::Local<v8::Object>
object
,
15
v8::Local<v8::Name>
key
,
16
v8::Local<v8::Value>
value) {
17
v8::TryCatch
tryCatch(context->GetIsolate());
18
v8::Isolate::DisallowJavascriptExecutionScope
throwJs(
19
context->GetIsolate(),
20
v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE
);
21
return
object
->CreateDataProperty(context,
key
, value);
22
}
23
24
v8::Maybe<bool>
createDataProperty
(
v8::Local<v8::Context>
context,
25
v8::Local<v8::Array>
array,
int
index,
26
v8::Local<v8::Value>
value) {
27
v8::TryCatch
tryCatch(context->GetIsolate());
28
v8::Isolate::DisallowJavascriptExecutionScope
throwJs(
29
context->GetIsolate(),
30
v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE
);
31
return
array->CreateDataProperty(context, index, value);
32
}
33
}
// namespace v8_inspector
v8::Isolate::DisallowJavascriptExecutionScope
Definition
v8-isolate.h:387
v8::Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE
@ THROW_ON_FAILURE
Definition
v8-isolate.h:389
v8::Local
Definition
v8-local-handle.h:267
v8::Maybe
Definition
v8-maybe.h:33
v8::TryCatch
Definition
v8-exception.h:138
v8_inspector
Definition
debug-interface.h:25
v8_inspector::createDataProperty
v8::Maybe< bool > createDataProperty(v8::Local< v8::Context > context, v8::Local< v8::Object > object, v8::Local< v8::Name > key, v8::Local< v8::Value > value)
Definition
v8-value-utils.cc:13
v8-container.h
v8-context.h
v8-exception.h
v8-value-utils.h
key
std::unique_ptr< ValueMirror > key
Definition
value-mirror.cc:949
src
inspector
v8-value-utils.cc
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0