node-darwin-x64 25.9.0 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -1436
- package/bin/node +0 -0
- package/include/node/common.gypi +13 -1
- package/include/node/config.gypi +5 -9
- package/include/node/cppgc/allocation.h +6 -7
- package/include/node/cppgc/heap-statistics.h +6 -2
- package/include/node/cppgc/internal/api-constants.h +1 -1
- package/include/node/cppgc/visitor.h +1 -0
- package/include/node/libplatform/v8-tracing.h +13 -2
- package/include/node/node.h +1 -1
- package/include/node/node_object_wrap.h +4 -2
- package/include/node/node_version.h +3 -3
- package/include/node/uv/unix.h +1 -4
- package/include/node/uv/version.h +2 -2
- package/include/node/uv/win.h +1 -1
- package/include/node/uv.h +7 -8
- package/include/node/v8-array-buffer.h +10 -0
- package/include/node/v8-callbacks.h +15 -6
- package/include/node/v8-context.h +79 -27
- package/include/node/v8-data.h +7 -1
- package/include/node/v8-debug.h +23 -3
- package/include/node/v8-exception.h +7 -4
- package/include/node/v8-extension.h +0 -2
- package/include/node/v8-external.h +40 -4
- package/include/node/v8-function-callback.h +172 -183
- package/include/node/v8-function.h +2 -2
- package/include/node/v8-initialization.h +29 -0
- package/include/node/v8-internal.h +149 -142
- package/include/node/v8-isolate.h +35 -22
- package/include/node/v8-local-handle.h +1 -1
- package/include/node/v8-memory-span.h +4 -59
- package/include/node/v8-message.h +0 -8
- package/include/node/v8-object.h +85 -92
- package/include/node/v8-persistent-handle.h +2 -9
- package/include/node/v8-platform.h +167 -58
- package/include/node/v8-primitive.h +5 -57
- package/include/node/v8-profiler.h +69 -3
- package/include/node/v8-promise.h +16 -5
- package/include/node/v8-sandbox.h +34 -53
- package/include/node/v8-script.h +27 -0
- package/include/node/v8-source-location.h +9 -8
- package/include/node/v8-statistics.h +8 -0
- package/include/node/v8-template.h +44 -122
- package/include/node/v8-version.h +3 -3
- package/include/node/v8-wasm.h +118 -21
- package/include/node/v8config.h +10 -8
- package/package.json +1 -1
- package/share/doc/node/gdbinit +79 -0
- package/share/doc/node/lldb_commands.py +6 -0
- package/share/man/man1/node.1 +0 -6
|
@@ -62,41 +62,7 @@ enum class CppHeapPointerTag : uint16_t {
|
|
|
62
62
|
kLastTag = 0x7fff,
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
// against supertypes, which cover a range of types (their subtypes).
|
|
67
|
-
// Both the lower- and the upper bound are inclusive. In other words, this
|
|
68
|
-
// struct represents the range [lower_bound, upper_bound].
|
|
69
|
-
// TODO(saelo): reuse internal::TagRange here.
|
|
70
|
-
struct CppHeapPointerTagRange {
|
|
71
|
-
constexpr CppHeapPointerTagRange(CppHeapPointerTag lower,
|
|
72
|
-
CppHeapPointerTag upper)
|
|
73
|
-
: lower_bound(lower), upper_bound(upper) {}
|
|
74
|
-
CppHeapPointerTag lower_bound;
|
|
75
|
-
CppHeapPointerTag upper_bound;
|
|
76
|
-
|
|
77
|
-
// Check whether the tag of the given CppHeapPointerTable entry is within
|
|
78
|
-
// this range. This method encodes implementation details of the
|
|
79
|
-
// CppHeapPointerTable, which is necessary as it is used by
|
|
80
|
-
// ReadCppHeapPointerField below.
|
|
81
|
-
// Returns true if the check is successful and the tag of the given entry is
|
|
82
|
-
// within this range, false otherwise.
|
|
83
|
-
bool CheckTagOf(uint64_t entry) {
|
|
84
|
-
// Note: the cast to uint32_t is important here. Otherwise, the uint16_t's
|
|
85
|
-
// would be promoted to int in the range check below, which would result in
|
|
86
|
-
// undefined behavior (signed integer undeflow) if the actual value is less
|
|
87
|
-
// than the lower bound. Then, the compiler would take advantage of the
|
|
88
|
-
// undefined behavior and turn the range check into a simple
|
|
89
|
-
// `actual_tag <= last_tag` comparison, which is incorrect.
|
|
90
|
-
uint32_t actual_tag = static_cast<uint16_t>(entry);
|
|
91
|
-
// The actual_tag is shifted to the left by one and contains the marking
|
|
92
|
-
// bit in the LSB. To ignore that during the type check, simply add one to
|
|
93
|
-
// the (shifted) range.
|
|
94
|
-
constexpr int kTagShift = internal::kCppHeapPointerTagShift;
|
|
95
|
-
uint32_t first_tag = static_cast<uint32_t>(lower_bound) << kTagShift;
|
|
96
|
-
uint32_t last_tag = (static_cast<uint32_t>(upper_bound) << kTagShift) + 1;
|
|
97
|
-
return actual_tag >= first_tag && actual_tag <= last_tag;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
65
|
+
using CppHeapPointerTagRange = internal::TagRange<CppHeapPointerTag>;
|
|
100
66
|
|
|
101
67
|
constexpr CppHeapPointerTagRange kAnyCppHeapPointer(
|
|
102
68
|
CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag);
|
|
@@ -115,16 +81,6 @@ class SandboxHardwareSupport {
|
|
|
115
81
|
* hardware permissions to the memory that will be inherited on clone.
|
|
116
82
|
*/
|
|
117
83
|
V8_EXPORT static void InitializeBeforeThreadCreation();
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Prepares the current thread for executing sandboxed code.
|
|
121
|
-
*
|
|
122
|
-
* This must be called on newly created threads before they execute any
|
|
123
|
-
* sandboxed code (in particular any JavaScript or WebAssembly code). It
|
|
124
|
-
* should not be invoked on threads that never execute sandboxed code,
|
|
125
|
-
* although it is fine to do so from a security point of view.
|
|
126
|
-
*/
|
|
127
|
-
V8_EXPORT static void PrepareCurrentThreadForHardwareSandboxing();
|
|
128
84
|
};
|
|
129
85
|
|
|
130
86
|
namespace internal {
|
|
@@ -133,7 +89,7 @@ namespace internal {
|
|
|
133
89
|
V8_INLINE static Address* GetCppHeapPointerTableBase(v8::Isolate* isolate) {
|
|
134
90
|
Address addr = reinterpret_cast<Address>(isolate) +
|
|
135
91
|
Internals::kIsolateCppHeapPointerTableOffset +
|
|
136
|
-
Internals::
|
|
92
|
+
Internals::kExternalEntityTableBasePointerOffset;
|
|
137
93
|
return *reinterpret_cast<Address**>(addr);
|
|
138
94
|
}
|
|
139
95
|
#endif // V8_COMPRESS_POINTERS
|
|
@@ -142,9 +98,12 @@ template <typename T>
|
|
|
142
98
|
V8_INLINE static T* ReadCppHeapPointerField(v8::Isolate* isolate,
|
|
143
99
|
Address heap_object_ptr, int offset,
|
|
144
100
|
CppHeapPointerTagRange tag_range) {
|
|
101
|
+
// This is a specialized version of the the CppHeapPointerTable accessors
|
|
102
|
+
// which (1) allows the code to be inlined into the callers for performance
|
|
103
|
+
// and (2) is optimized for code size as there are a huge number of callers
|
|
104
|
+
// from auto-generated bindings code.
|
|
105
|
+
|
|
145
106
|
#ifdef V8_COMPRESS_POINTERS
|
|
146
|
-
// See src/sandbox/cppheap-pointer-table-inl.h. Logic duplicated here so
|
|
147
|
-
// it can be inlined and doesn't require an additional call.
|
|
148
107
|
const CppHeapPointerHandle handle =
|
|
149
108
|
Internals::ReadRawField<CppHeapPointerHandle>(heap_object_ptr, offset);
|
|
150
109
|
const uint32_t index = handle >> kExternalPointerIndexShift;
|
|
@@ -153,9 +112,21 @@ V8_INLINE static T* ReadCppHeapPointerField(v8::Isolate* isolate,
|
|
|
153
112
|
reinterpret_cast<const std::atomic<Address>*>(&table[index]);
|
|
154
113
|
Address entry = std::atomic_load_explicit(ptr, std::memory_order_relaxed);
|
|
155
114
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
115
|
+
// Note: the cast to uint32_t is important here. Otherwise, the uint16_t's
|
|
116
|
+
// would be promoted to int in the range check below, which would result in
|
|
117
|
+
// undefined behavior (signed integer underflow) if the actual value is less
|
|
118
|
+
// than the lower bound. Then, the compiler would take advantage of the
|
|
119
|
+
// undefined behavior and turn the range check into a simple
|
|
120
|
+
// `actual_tag <= last_tag` comparison, which is incorrect.
|
|
121
|
+
uint32_t actual_tag = static_cast<uint16_t>(entry);
|
|
122
|
+
// The actual_tag is shifted to the left by one and contains the marking
|
|
123
|
+
// bit in the LSB. To ignore that during the type check, simply add one to
|
|
124
|
+
// the (shifted) range.
|
|
125
|
+
constexpr int kTagShift = internal::kCppHeapPointerTagShift;
|
|
126
|
+
uint32_t first_tag = static_cast<uint32_t>(tag_range.first) << kTagShift;
|
|
127
|
+
uint32_t last_tag = (static_cast<uint32_t>(tag_range.last) << kTagShift) + 1;
|
|
128
|
+
if (V8_LIKELY(actual_tag >= first_tag && actual_tag <= last_tag)) {
|
|
129
|
+
entry = entry >> kCppHeapPointerPayloadShift;
|
|
159
130
|
} else {
|
|
160
131
|
// If the type check failed, we simply return nullptr here. That way:
|
|
161
132
|
// 1. The null handle always results in nullptr being returned here, which
|
|
@@ -174,15 +145,25 @@ V8_INLINE static T* ReadCppHeapPointerField(v8::Isolate* isolate,
|
|
|
174
145
|
// between returning nullptr or the original entry, since it will
|
|
175
146
|
// simply compile to a `csel x0, x8, xzr, lo` instead of a
|
|
176
147
|
// `csel x0, x10, x8, lo` instruction.
|
|
177
|
-
|
|
148
|
+
// 3. The machine code sequence ends up being pretty short, which is
|
|
149
|
+
// important here as this code will be inlined into a lot of functions.
|
|
150
|
+
entry = 0;
|
|
178
151
|
}
|
|
179
|
-
return reinterpret_cast<T*>(
|
|
152
|
+
return reinterpret_cast<T*>(entry);
|
|
180
153
|
#else // !V8_COMPRESS_POINTERS
|
|
181
154
|
return reinterpret_cast<T*>(
|
|
182
155
|
Internals::ReadRawField<Address>(heap_object_ptr, offset));
|
|
183
156
|
#endif // !V8_COMPRESS_POINTERS
|
|
184
157
|
}
|
|
185
158
|
|
|
159
|
+
// TODO(saelo): temporary workaround needed to introduce range-based type
|
|
160
|
+
// checks for the external pointer table. See comment above
|
|
161
|
+
// ExternalPointerCanBeEmpty(ExternalPointerTagRange) function for details.
|
|
162
|
+
V8_INLINE static constexpr bool ExternalPointerCanBeEmpty(
|
|
163
|
+
CppHeapPointerTagRange tag_range) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
186
167
|
} // namespace internal
|
|
187
168
|
} // namespace v8
|
|
188
169
|
|
package/include/node/v8-script.h
CHANGED
|
@@ -64,7 +64,13 @@ class V8_EXPORT UnboundScript : public Data {
|
|
|
64
64
|
*/
|
|
65
65
|
Local<Script> BindToCurrentContext();
|
|
66
66
|
|
|
67
|
+
/*
|
|
68
|
+
* A unique id.
|
|
69
|
+
*/
|
|
70
|
+
int ScriptId() const;
|
|
71
|
+
V8_DEPRECATE_SOON("Use ScriptId")
|
|
67
72
|
int GetId() const;
|
|
73
|
+
|
|
68
74
|
Local<Value> GetScriptName();
|
|
69
75
|
|
|
70
76
|
/**
|
|
@@ -104,8 +110,17 @@ class V8_EXPORT UnboundModuleScript : public Data {
|
|
|
104
110
|
* Data read from magic sourceMappingURL comments.
|
|
105
111
|
*/
|
|
106
112
|
Local<Value> GetSourceMappingURL();
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* A unique id.
|
|
116
|
+
*/
|
|
117
|
+
int ScriptId() const;
|
|
118
|
+
|
|
119
|
+
static const int kNoScriptId = 0;
|
|
107
120
|
};
|
|
108
121
|
|
|
122
|
+
static_assert(UnboundModuleScript::kNoScriptId == UnboundScript::kNoScriptId);
|
|
123
|
+
|
|
109
124
|
/**
|
|
110
125
|
* A location in JavaScript source.
|
|
111
126
|
*/
|
|
@@ -187,6 +202,13 @@ class V8_EXPORT Module : public Data {
|
|
|
187
202
|
kErrored
|
|
188
203
|
};
|
|
189
204
|
|
|
205
|
+
/**
|
|
206
|
+
* If the module is a Source Text Module, returns the name that was passed
|
|
207
|
+
* by the embedder as resource_name to the ScriptOrigin. If it's a Synthetic
|
|
208
|
+
* Module, returns the module_name passed to CreateSyntheticModule().
|
|
209
|
+
*/
|
|
210
|
+
Local<Value> GetResourceName() const;
|
|
211
|
+
|
|
190
212
|
/**
|
|
191
213
|
* Returns the module's current status.
|
|
192
214
|
*/
|
|
@@ -390,6 +412,11 @@ class V8_EXPORT Script : public Data {
|
|
|
390
412
|
*/
|
|
391
413
|
Local<UnboundScript> GetUnboundScript();
|
|
392
414
|
|
|
415
|
+
/**
|
|
416
|
+
* Returns the id of the corresponding context-unbound script.
|
|
417
|
+
*/
|
|
418
|
+
int ScriptId() const;
|
|
419
|
+
|
|
393
420
|
/**
|
|
394
421
|
* The name that was passed by the embedder as ResourceName to the
|
|
395
422
|
* ScriptOrigin. This can be either a v8::String or v8::Undefined.
|
|
@@ -22,7 +22,7 @@ namespace v8 {
|
|
|
22
22
|
class V8_EXPORT SourceLocation final {
|
|
23
23
|
public:
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Constructs source location information corresponding to the location of the
|
|
26
26
|
* call site.
|
|
27
27
|
*/
|
|
28
28
|
static constexpr SourceLocation Current(
|
|
@@ -70,13 +70,14 @@ class V8_EXPORT SourceLocation final {
|
|
|
70
70
|
*
|
|
71
71
|
* \returns a human-readable string representing source location information.
|
|
72
72
|
*/
|
|
73
|
-
std::string ToString() const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
std::string ToString() const;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Checks whether this object is initialized.
|
|
77
|
+
*
|
|
78
|
+
* \returns true if this object is initialized, false otherwise.
|
|
79
|
+
*/
|
|
80
|
+
operator bool() const { return loc_.line() != 0; }
|
|
80
81
|
|
|
81
82
|
private:
|
|
82
83
|
constexpr explicit SourceLocation(const std::source_location& loc)
|
|
@@ -154,6 +154,13 @@ class V8_EXPORT HeapStatistics {
|
|
|
154
154
|
size_t number_of_native_contexts() { return number_of_native_contexts_; }
|
|
155
155
|
size_t number_of_detached_contexts() { return number_of_detached_contexts_; }
|
|
156
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Returns the total number of bytes allocated since the Isolate was created.
|
|
159
|
+
* This includes all heap objects allocated in any space (new, old, code,
|
|
160
|
+
* etc.).
|
|
161
|
+
*/
|
|
162
|
+
uint64_t total_allocated_bytes() { return total_allocated_bytes_; }
|
|
163
|
+
|
|
157
164
|
/**
|
|
158
165
|
* Returns a 0/1 boolean, which signifies whether the V8 overwrite heap
|
|
159
166
|
* garbage with a bit pattern.
|
|
@@ -175,6 +182,7 @@ class V8_EXPORT HeapStatistics {
|
|
|
175
182
|
size_t number_of_detached_contexts_;
|
|
176
183
|
size_t total_global_handles_size_;
|
|
177
184
|
size_t used_global_handles_size_;
|
|
185
|
+
uint64_t total_allocated_bytes_;
|
|
178
186
|
|
|
179
187
|
friend class V8;
|
|
180
188
|
friend class Isolate;
|
|
@@ -135,11 +135,14 @@ class V8_EXPORT Template : public Data {
|
|
|
135
135
|
/**
|
|
136
136
|
* Interceptor callbacks use this value to indicate whether the request was
|
|
137
137
|
* intercepted or not.
|
|
138
|
+
*
|
|
139
|
+
* The values for constants and type are chosen this way for better
|
|
140
|
+
* performance.
|
|
138
141
|
*/
|
|
139
|
-
enum class Intercepted :
|
|
142
|
+
enum class Intercepted : uint32_t { kNo = 1, kYes = 0 };
|
|
140
143
|
|
|
141
144
|
/**
|
|
142
|
-
* Interceptor for
|
|
145
|
+
* Interceptor for [[Get]] requests on an object.
|
|
143
146
|
*
|
|
144
147
|
* If the interceptor handles the request (i.e. the property should not be
|
|
145
148
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
@@ -153,8 +156,8 @@ enum class Intercepted : uint8_t { kNo = 0, kYes = 1 };
|
|
|
153
156
|
* \param property The name of the property for which the request was
|
|
154
157
|
* intercepted.
|
|
155
158
|
* \param info Information about the intercepted request, such as
|
|
156
|
-
* isolate,
|
|
157
|
-
*
|
|
159
|
+
* isolate, object holding the property, return value. See
|
|
160
|
+
* `PropertyCallbackInfo`.
|
|
158
161
|
*
|
|
159
162
|
* \code
|
|
160
163
|
* Intercepted GetterCallback(
|
|
@@ -183,21 +186,20 @@ enum class Intercepted : uint8_t { kNo = 0, kYes = 1 };
|
|
|
183
186
|
*/
|
|
184
187
|
using NamedPropertyGetterCallback = Intercepted (*)(
|
|
185
188
|
Local<Name> property, const PropertyCallbackInfo<Value>& info);
|
|
186
|
-
// This variant will be deprecated soon.
|
|
187
|
-
//
|
|
188
|
-
// Use `info.GetReturnValue().Set()` to set the return value of the
|
|
189
|
-
// intercepted get request. If the property does not exist the callback should
|
|
190
|
-
// not set the result and must not produce side effects.
|
|
191
|
-
using GenericNamedPropertyGetterCallback V8_DEPRECATE_SOON(
|
|
192
|
-
"Use NamedPropertyGetterCallback instead") =
|
|
193
|
-
void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info);
|
|
194
189
|
|
|
195
190
|
/**
|
|
196
|
-
* Interceptor for
|
|
191
|
+
* Interceptor for [[Set]] requests on an object.
|
|
197
192
|
*
|
|
198
193
|
* If the interceptor handles the request (i.e. the property should not be
|
|
199
194
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
200
|
-
* should
|
|
195
|
+
* should
|
|
196
|
+
* - use `info.GetReturnValue().Set(false)` to indicate that the operation
|
|
197
|
+
* failed,
|
|
198
|
+
* - (optionally) upon operation failure and info.ShouldThrowOnError()
|
|
199
|
+
* is true (indicating execution in `'use strict'` mode) the callback can
|
|
200
|
+
* throw TypeError if the error message needs to include more details than
|
|
201
|
+
* a TypeError thrown by V8 in this case,
|
|
202
|
+
* - return `Intercepted::kYes`.
|
|
201
203
|
* If the interceptor does not handle the request it must return
|
|
202
204
|
* `Intercepted::kNo` and it must not produce side effects.
|
|
203
205
|
*
|
|
@@ -206,31 +208,19 @@ using GenericNamedPropertyGetterCallback V8_DEPRECATE_SOON(
|
|
|
206
208
|
* \param value The value which the property will have if the request
|
|
207
209
|
* is not intercepted.
|
|
208
210
|
* \param info Information about the intercepted request, such as
|
|
209
|
-
* isolate,
|
|
210
|
-
* See `PropertyCallbackInfo`.
|
|
211
|
+
* isolate, object holding the property, return value, or whether running in
|
|
212
|
+
* `'use strict'` mode. See `PropertyCallbackInfo`.
|
|
211
213
|
*
|
|
212
214
|
* See also `ObjectTemplate::SetHandler.`
|
|
213
215
|
*/
|
|
214
216
|
using NamedPropertySetterCallback =
|
|
215
217
|
Intercepted (*)(Local<Name> property, Local<Value> value,
|
|
216
218
|
const PropertyCallbackInfo<void>& info);
|
|
217
|
-
// This variant will be deprecated soon.
|
|
218
|
-
//
|
|
219
|
-
// Use `info.GetReturnValue()` to indicate whether the request was intercepted
|
|
220
|
-
// or not. If the setter successfully intercepts the request, i.e., if the
|
|
221
|
-
// request should not be further executed, call
|
|
222
|
-
// `info.GetReturnValue().Set(value)`. If the setter did not intercept the
|
|
223
|
-
// request, i.e., if the request should be handled as if no interceptor is
|
|
224
|
-
// present, do not not call `Set()` and do not produce side effects.
|
|
225
|
-
using GenericNamedPropertySetterCallback V8_DEPRECATE_SOON(
|
|
226
|
-
"Use NamedPropertySetterCallback instead") =
|
|
227
|
-
void (*)(Local<Name> property, Local<Value> value,
|
|
228
|
-
const PropertyCallbackInfo<Value>& info);
|
|
229
219
|
|
|
230
220
|
/**
|
|
231
|
-
* Intercepts all requests that query the attributes of the
|
|
232
|
-
*
|
|
233
|
-
*
|
|
221
|
+
* Intercepts all requests that query the attributes of the property,
|
|
222
|
+
* e.g. [[GetOwnProperty]], [[DefineOwnProperty]], [[Set]] and derived ones
|
|
223
|
+
* like Object.prototype.propertyIsEnumerable() and similar.
|
|
234
224
|
*
|
|
235
225
|
* If the interceptor handles the request (i.e. the property should not be
|
|
236
226
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
@@ -255,24 +245,19 @@ using GenericNamedPropertySetterCallback V8_DEPRECATE_SOON(
|
|
|
255
245
|
*/
|
|
256
246
|
using NamedPropertyQueryCallback = Intercepted (*)(
|
|
257
247
|
Local<Name> property, const PropertyCallbackInfo<Integer>& info);
|
|
258
|
-
// This variant will be deprecated soon.
|
|
259
|
-
//
|
|
260
|
-
// Use `info.GetReturnValue().Set(value)` to set the property attributes. The
|
|
261
|
-
// value is an integer encoding a `v8::PropertyAttribute`. If the property does
|
|
262
|
-
// not exist the callback should not set the result and must not produce side
|
|
263
|
-
// effects.
|
|
264
|
-
using GenericNamedPropertyQueryCallback V8_DEPRECATE_SOON(
|
|
265
|
-
"Use NamedPropertyQueryCallback instead") =
|
|
266
|
-
void (*)(Local<Name> property, const PropertyCallbackInfo<Integer>& info);
|
|
267
248
|
|
|
268
249
|
/**
|
|
269
|
-
* Interceptor for
|
|
250
|
+
* Interceptor for [[Delete]] requests on an object.
|
|
270
251
|
*
|
|
271
252
|
* If the interceptor handles the request (i.e. the property should not be
|
|
272
253
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
273
254
|
* should
|
|
274
|
-
* -
|
|
275
|
-
*
|
|
255
|
+
* - use `info.GetReturnValue().Set(false)` to indicate that the operation
|
|
256
|
+
* failed,
|
|
257
|
+
* - (optionally) upon operation failure and info.ShouldThrowOnError()
|
|
258
|
+
* is true (indicating execution in `'use strict'` mode) the callback can
|
|
259
|
+
* throw TypeError if the error message needs to include more details than
|
|
260
|
+
* a TypeError thrown by V8 in this case,
|
|
276
261
|
* - return `Intercepted::kYes`.
|
|
277
262
|
* If the interceptor does not handle the request it must return
|
|
278
263
|
* `Intercepted::kNo` and it must not produce side effects.
|
|
@@ -280,28 +265,13 @@ using GenericNamedPropertyQueryCallback V8_DEPRECATE_SOON(
|
|
|
280
265
|
* \param property The name of the property for which the request was
|
|
281
266
|
* intercepted.
|
|
282
267
|
* \param info Information about the intercepted request, such as
|
|
283
|
-
* isolate,
|
|
284
|
-
* See `PropertyCallbackInfo`.
|
|
285
|
-
*
|
|
286
|
-
* \note If you need to mimic the behavior of `delete`, i.e., throw in strict
|
|
287
|
-
* mode instead of returning false, use `info.ShouldThrowOnError()` to determine
|
|
288
|
-
* if you are in strict mode.
|
|
268
|
+
* isolate, object holding the property, return value, or whether running in
|
|
269
|
+
* `'use strict'` mode. See `PropertyCallbackInfo`.
|
|
289
270
|
*
|
|
290
271
|
* See also `ObjectTemplate::SetHandler.`
|
|
291
272
|
*/
|
|
292
273
|
using NamedPropertyDeleterCallback = Intercepted (*)(
|
|
293
274
|
Local<Name> property, const PropertyCallbackInfo<Boolean>& info);
|
|
294
|
-
// This variant will be deprecated soon.
|
|
295
|
-
//
|
|
296
|
-
// Use `info.GetReturnValue()` to indicate whether the request was intercepted
|
|
297
|
-
// or not. If the deleter successfully intercepts the request, i.e., if the
|
|
298
|
-
// request should not be further executed, call
|
|
299
|
-
// `info.GetReturnValue().Set(value)` with a boolean `value`. The `value` is
|
|
300
|
-
// used as the return value of `delete`. If the deleter does not intercept the
|
|
301
|
-
// request then it should not set the result and must not produce side effects.
|
|
302
|
-
using GenericNamedPropertyDeleterCallback V8_DEPRECATE_SOON(
|
|
303
|
-
"Use NamedPropertyDeleterCallback instead") =
|
|
304
|
-
void (*)(Local<Name> property, const PropertyCallbackInfo<Boolean>& info);
|
|
305
275
|
|
|
306
276
|
/**
|
|
307
277
|
* Returns an array containing the names of the properties the named
|
|
@@ -311,18 +281,20 @@ using GenericNamedPropertyDeleterCallback V8_DEPRECATE_SOON(
|
|
|
311
281
|
*/
|
|
312
282
|
using NamedPropertyEnumeratorCallback =
|
|
313
283
|
void (*)(const PropertyCallbackInfo<Array>& info);
|
|
314
|
-
// This variant will be deprecated soon.
|
|
315
|
-
// This is just a renaming of the typedef.
|
|
316
|
-
using GenericNamedPropertyEnumeratorCallback V8_DEPRECATE_SOON(
|
|
317
|
-
"Use NamedPropertyEnumeratorCallback instead") =
|
|
318
|
-
NamedPropertyEnumeratorCallback;
|
|
319
284
|
|
|
320
285
|
/**
|
|
321
|
-
* Interceptor for
|
|
286
|
+
* Interceptor for [[DefineOwnProperty]] requests on an object.
|
|
322
287
|
*
|
|
323
288
|
* If the interceptor handles the request (i.e. the property should not be
|
|
324
289
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
325
|
-
* should
|
|
290
|
+
* should
|
|
291
|
+
* - use `info.GetReturnValue().Set(false)` to indicate that the operation
|
|
292
|
+
* failed,
|
|
293
|
+
* - (optionally) upon operation failure and info.ShouldThrowOnError()
|
|
294
|
+
* is true (indicating execution in `'use strict'` mode) the callback can
|
|
295
|
+
* throw TypeError if the error message needs to include more details than
|
|
296
|
+
* a TypeError thrown by V8 in this case,
|
|
297
|
+
* - return `Intercepted::kYes`.
|
|
326
298
|
* If the interceptor does not handle the request it must return
|
|
327
299
|
* `Intercepted::kNo` and it must not produce side effects.
|
|
328
300
|
*
|
|
@@ -331,29 +303,17 @@ using GenericNamedPropertyEnumeratorCallback V8_DEPRECATE_SOON(
|
|
|
331
303
|
* \param desc The property descriptor which is used to define the
|
|
332
304
|
* property if the request is not intercepted.
|
|
333
305
|
* \param info Information about the intercepted request, such as
|
|
334
|
-
* isolate,
|
|
335
|
-
* See `PropertyCallbackInfo`.
|
|
306
|
+
* isolate, object holding the property, return value, or whether running in
|
|
307
|
+
* `'use strict'` mode. See `PropertyCallbackInfo`.
|
|
336
308
|
*
|
|
337
309
|
* See also `ObjectTemplate::SetHandler`.
|
|
338
310
|
*/
|
|
339
311
|
using NamedPropertyDefinerCallback =
|
|
340
312
|
Intercepted (*)(Local<Name> property, const PropertyDescriptor& desc,
|
|
341
313
|
const PropertyCallbackInfo<void>& info);
|
|
342
|
-
// This variant will be deprecated soon.
|
|
343
|
-
//
|
|
344
|
-
// Use `info.GetReturnValue()` to indicate whether the request was intercepted
|
|
345
|
-
// or not. If the definer successfully intercepts the request, i.e., if the
|
|
346
|
-
// request should not be further executed, call
|
|
347
|
-
// `info.GetReturnValue().Set(value)`. If the definer did not intercept the
|
|
348
|
-
// request, i.e., if the request should be handled as if no interceptor is
|
|
349
|
-
// present, do not not call `Set()` and do not produce side effects.
|
|
350
|
-
using GenericNamedPropertyDefinerCallback V8_DEPRECATE_SOON(
|
|
351
|
-
"Use NamedPropertyDefinerCallback instead") =
|
|
352
|
-
void (*)(Local<Name> property, const PropertyDescriptor& desc,
|
|
353
|
-
const PropertyCallbackInfo<Value>& info);
|
|
354
314
|
|
|
355
315
|
/**
|
|
356
|
-
* Interceptor for
|
|
316
|
+
* Interceptor for [[GetOwnProperty]] requests on an object.
|
|
357
317
|
*
|
|
358
318
|
* If the interceptor handles the request (i.e. the property should not be
|
|
359
319
|
* looked up beyond the interceptor or in case an exception was thrown) it
|
|
@@ -371,22 +331,10 @@ using GenericNamedPropertyDefinerCallback V8_DEPRECATE_SOON(
|
|
|
371
331
|
* isolate, receiver, return value, or whether running in `'use strict'` mode.
|
|
372
332
|
* See `PropertyCallbackInfo`.
|
|
373
333
|
*
|
|
374
|
-
* \note If GetOwnPropertyDescriptor is intercepted, it will
|
|
375
|
-
* always return true, i.e., indicate that the property was found.
|
|
376
|
-
*
|
|
377
334
|
* See also `ObjectTemplate::SetHandler`.
|
|
378
335
|
*/
|
|
379
336
|
using NamedPropertyDescriptorCallback = Intercepted (*)(
|
|
380
337
|
Local<Name> property, const PropertyCallbackInfo<Value>& info);
|
|
381
|
-
// This variant will be deprecated soon.
|
|
382
|
-
//
|
|
383
|
-
// Use `info.GetReturnValue().Set()` to set the return value of the
|
|
384
|
-
// intercepted request. The return value must be an object that
|
|
385
|
-
// can be converted to a PropertyDescriptor, e.g., a `v8::Value` returned from
|
|
386
|
-
// `v8::Object::getOwnPropertyDescriptor`.
|
|
387
|
-
using GenericNamedPropertyDescriptorCallback V8_DEPRECATE_SOON(
|
|
388
|
-
"Use NamedPropertyDescriptorCallback instead") =
|
|
389
|
-
void (*)(Local<Name> property, const PropertyCallbackInfo<Value>& info);
|
|
390
338
|
|
|
391
339
|
// TODO(ishell): Rename IndexedPropertyXxxCallbackV2 back to
|
|
392
340
|
// IndexedPropertyXxxCallback once the old IndexedPropertyXxxCallback is
|
|
@@ -397,41 +345,24 @@ using GenericNamedPropertyDescriptorCallback V8_DEPRECATE_SOON(
|
|
|
397
345
|
*/
|
|
398
346
|
using IndexedPropertyGetterCallbackV2 =
|
|
399
347
|
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
|
|
400
|
-
// This variant will be deprecated soon.
|
|
401
|
-
using IndexedPropertyGetterCallback V8_DEPRECATE_SOON(
|
|
402
|
-
"Use IndexedPropertyGetterCallbackV2 instead") =
|
|
403
|
-
void (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
|
|
404
348
|
|
|
405
349
|
/**
|
|
406
350
|
* See `v8::NamedPropertySetterCallback`.
|
|
407
351
|
*/
|
|
408
352
|
using IndexedPropertySetterCallbackV2 = Intercepted (*)(
|
|
409
353
|
uint32_t index, Local<Value> value, const PropertyCallbackInfo<void>& info);
|
|
410
|
-
// This variant will be deprecated soon.
|
|
411
|
-
using IndexedPropertySetterCallback V8_DEPRECATE_SOON(
|
|
412
|
-
"Use IndexedPropertySetterCallbackV2 instead") =
|
|
413
|
-
void (*)(uint32_t index, Local<Value> value,
|
|
414
|
-
const PropertyCallbackInfo<Value>& info);
|
|
415
354
|
|
|
416
355
|
/**
|
|
417
356
|
* See `v8::NamedPropertyQueryCallback`.
|
|
418
357
|
*/
|
|
419
358
|
using IndexedPropertyQueryCallbackV2 =
|
|
420
359
|
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Integer>& info);
|
|
421
|
-
// This variant will be deprecated soon.
|
|
422
|
-
using IndexedPropertyQueryCallback V8_DEPRECATE_SOON(
|
|
423
|
-
"Use IndexedPropertyQueryCallbackV2 instead") =
|
|
424
|
-
void (*)(uint32_t index, const PropertyCallbackInfo<Integer>& info);
|
|
425
360
|
|
|
426
361
|
/**
|
|
427
362
|
* See `v8::NamedPropertyDeleterCallback`.
|
|
428
363
|
*/
|
|
429
364
|
using IndexedPropertyDeleterCallbackV2 =
|
|
430
365
|
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Boolean>& info);
|
|
431
|
-
// This variant will be deprecated soon.
|
|
432
|
-
using IndexedPropertyDeleterCallback V8_DEPRECATE_SOON(
|
|
433
|
-
"Use IndexedPropertyDeleterCallbackV2 instead") =
|
|
434
|
-
void (*)(uint32_t index, const PropertyCallbackInfo<Boolean>& info);
|
|
435
366
|
|
|
436
367
|
/**
|
|
437
368
|
* Returns an array containing the indices of the properties the indexed
|
|
@@ -448,21 +379,12 @@ using IndexedPropertyEnumeratorCallback =
|
|
|
448
379
|
using IndexedPropertyDefinerCallbackV2 =
|
|
449
380
|
Intercepted (*)(uint32_t index, const PropertyDescriptor& desc,
|
|
450
381
|
const PropertyCallbackInfo<void>& info);
|
|
451
|
-
// This variant will be deprecated soon.
|
|
452
|
-
using IndexedPropertyDefinerCallback V8_DEPRECATE_SOON(
|
|
453
|
-
"Use IndexedPropertyDefinerCallbackV2 instead") =
|
|
454
|
-
void (*)(uint32_t index, const PropertyDescriptor& desc,
|
|
455
|
-
const PropertyCallbackInfo<Value>& info);
|
|
456
382
|
|
|
457
383
|
/**
|
|
458
384
|
* See `v8::NamedPropertyDescriptorCallback`.
|
|
459
385
|
*/
|
|
460
386
|
using IndexedPropertyDescriptorCallbackV2 =
|
|
461
387
|
Intercepted (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
|
|
462
|
-
// This variant will be deprecated soon.
|
|
463
|
-
using IndexedPropertyDescriptorCallback V8_DEPRECATE_SOON(
|
|
464
|
-
"Use IndexedPropertyDescriptorCallbackV2 instead") =
|
|
465
|
-
void (*)(uint32_t index, const PropertyCallbackInfo<Value>& info);
|
|
466
388
|
|
|
467
389
|
/**
|
|
468
390
|
* Returns true if the given context should be allowed to access the given
|
|
@@ -632,7 +554,7 @@ class V8_EXPORT FunctionTemplate : public Template {
|
|
|
632
554
|
* API call, see the comment above the class declaration.
|
|
633
555
|
*/
|
|
634
556
|
void SetCallHandler(
|
|
635
|
-
FunctionCallback callback, Local<
|
|
557
|
+
FunctionCallback callback, Local<Data> data = {},
|
|
636
558
|
SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
|
|
637
559
|
const MemorySpan<const CFunction>& c_function_overloads = {});
|
|
638
560
|
|
|
@@ -1071,7 +993,7 @@ class V8_EXPORT ObjectTemplate : public Template {
|
|
|
1071
993
|
/**
|
|
1072
994
|
* A template to create dictionary objects at runtime.
|
|
1073
995
|
*/
|
|
1074
|
-
class V8_EXPORT DictionaryTemplate final {
|
|
996
|
+
class V8_EXPORT DictionaryTemplate final : public Data {
|
|
1075
997
|
public:
|
|
1076
998
|
/** Creates a new template. Also declares data properties that can be passed
|
|
1077
999
|
* on instantiation of the template. Properties can only be declared on
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
// NOTE these macros are used by some of the tool scripts and the build
|
|
10
10
|
// system so their names cannot be changed without changing the scripts.
|
|
11
11
|
#define V8_MAJOR_VERSION 14
|
|
12
|
-
#define V8_MINOR_VERSION
|
|
13
|
-
#define V8_BUILD_NUMBER
|
|
14
|
-
#define V8_PATCH_LEVEL
|
|
12
|
+
#define V8_MINOR_VERSION 6
|
|
13
|
+
#define V8_BUILD_NUMBER 202
|
|
14
|
+
#define V8_PATCH_LEVEL 33
|
|
15
15
|
|
|
16
16
|
// Use 1 for candidates and 0 otherwise.
|
|
17
17
|
// (Boolean macro values are not supported by all preprocessors.)
|