blob: 90ef565cad03c3a807c4b0cdaf09794c81bbd18e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
// 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.
@generateCppClass
extern class PromiseCapability extends Struct {
promise: JSReceiver|Undefined;
// TODO(joshualitt): Can these be typed more specifically.
resolve: Object;
reject: Object;
}
// 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 'PromiseReaction::kSize';
const kPromiseReactionFulfillHandlerOffset: constexpr int31
generates 'PromiseReaction::kFulfillHandlerOffset';
const kPromiseReactionPromiseOrCapabilityOffset: constexpr int31
generates 'PromiseReaction::kPromiseOrCapabilityOffset';
const kPromiseReactionContinuationPreservedEmbedderDataOffset: constexpr int31
generates 'PromiseReaction::kContinuationPreservedEmbedderDataOffset';
@generateCppClass
extern class PromiseReaction extends Struct {
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;
continuation_preserved_embedder_data: Object|Undefined;
}
// PromiseReactionJobTask constants
const kPromiseReactionJobTaskSizeOfAllPromiseReactionJobTasks: constexpr int31
generates 'PromiseReactionJobTask::kSizeOfAllPromiseReactionJobTasks';
const kPromiseReactionJobTaskHandlerOffset: constexpr int31
generates 'PromiseReactionJobTask::kHandlerOffset';
const kPromiseReactionJobTaskPromiseOrCapabilityOffset: constexpr int31
generates 'PromiseReactionJobTask::kPromiseOrCapabilityOffset';
const kPromiseReactionJobTaskContinuationPreservedEmbedderDataOffset:
constexpr int31
generates 'PromiseReactionJobTask::kContinuationPreservedEmbedderDataOffset'
;
@abstract
@generateCppClass
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;
continuation_preserved_embedder_data: Object|Undefined;
}
@generateCppClass
extern class PromiseFulfillReactionJobTask extends PromiseReactionJobTask {
}
@generateCppClass
extern class PromiseRejectReactionJobTask extends PromiseReactionJobTask {
}
@generateCppClass
extern class PromiseResolveThenableJobTask extends Microtask {
context: Context;
promise_to_resolve: JSPromise;
thenable: JSReceiver;
then: JSReceiver;
}
|