/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/objects/promise.tq
82 строки
3 KB
Michaël Zasso
deps: update V8 to 14.6.202.33
24 апр 2026, 19:01
Не верифицирован
24 апр 2026, 19:01
f1e0b83
Код
Авторство
О чём код?
// 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. @cppObjectLayoutDefinition extern class PromiseCapability extends Struct { promise: JSReceiver|Undefined; // Ideally, resolve and reject would be typed as Callable|Undefined. However, // the executor that creates the capability can be called in an arbitrary way // by user-provided thenable constructors, and these resolver functions are // not checked to be callable until after the user-provided thenable // constructor returns. IOW, the callable check timing is observable. resolve: JSAny; reject: JSAny; } // PromiseReaction constants type PromiseReactionType extends int31 constexpr 'PromiseReaction::Type'; const kPromiseReactionFulfill: constexpr PromiseReactionType generates 'PromiseReaction::kFulfill'; const kPromiseReactionReject: constexpr PromiseReactionType generates 'PromiseReaction::kReject'; const kPromiseReactionSize: constexpr int31 generates 'sizeof(PromiseReaction)'; const kPromiseReactionFulfillHandlerOffset: constexpr int31 generates 'ObjectTraits<PromiseReaction>::kFulfillHandlerOffset'; const kPromiseReactionPromiseOrCapabilityOffset: constexpr int31 generates 'ObjectTraits<PromiseReaction>::kPromiseOrCapabilityOffset'; // @if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA) const kPromiseReactionContinuationPreservedEmbedderDataOffset: constexpr int31 generates 'ObjectTraits<PromiseReaction>::kContinuationPreservedEmbedderDataOffset' ; @cppObjectLayoutDefinition extern class PromiseReaction extends Struct { @if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA) continuation_preserved_embedder_data: Object|Undefined; next: PromiseReaction|Zero; reject_handler: Callable|Undefined; fulfill_handler: Callable|Undefined; // Either a JSPromise (in case of native promises), a PromiseCapability // (general case), or undefined (in case of await). promise_or_capability: JSPromise|PromiseCapability|Undefined; } // PromiseReactionJobTask constants const kPromiseReactionJobTaskSizeOfAllPromiseReactionJobTasks: constexpr int31 generates 'sizeof(PromiseReactionJobTask)'; const kPromiseReactionJobTaskHandlerOffset: constexpr int31 generates 'ObjectTraits<PromiseReactionJobTask>::kHandlerOffset'; const kPromiseReactionJobTaskPromiseOrCapabilityOffset: constexpr int31 generates 'ObjectTraits<PromiseReactionJobTask>::kPromiseOrCapabilityOffset'; // @if(V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA) const kPromiseReactionJobTaskContinuationPreservedEmbedderDataOffset: constexpr int31 generates 'ObjectTraits<PromiseReactionJobTask>::kContinuationPreservedEmbedderDataOffset' ; @cppObjectLayoutDefinition @abstract extern class PromiseReactionJobTask extends Microtask { argument: Object; context: Context; handler: Callable|Undefined; // Either a JSPromise (in case of native promises), a PromiseCapability // (general case), or undefined (in case of await). promise_or_capability: JSPromise|PromiseCapability|Undefined; } @cppObjectLayoutDefinition extern class PromiseFulfillReactionJobTask extends PromiseReactionJobTask {} @cppObjectLayoutDefinition extern class PromiseRejectReactionJobTask extends PromiseReactionJobTask {} @cppObjectLayoutDefinition extern class PromiseResolveThenableJobTask extends Microtask { context: Context; promise_to_resolve: JSPromise; thenable: JSReceiver; then: JSReceiver; }