Skip to content

Commit

Permalink
src: add rudimentary Promise support
Browse files Browse the repository at this point in the history
This patch allows llnode to list Promise objects with findjsobjects,
findjsinstances and findrefs. We can investigate more fancy Promise
features in the future (such as listing handlers, Promise status, etc.).
  • Loading branch information
mmarchini committed Feb 25, 2019
1 parent c7ede80 commit 267cb15
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/llv8-constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ void Types::Load() {
kLastContextType = LoadConstant("LastContextType");

kJSErrorType = LoadConstant("type_JSError__JS_ERROR_TYPE");
kJSPromiseType = LoadConstant("type_JSPromise__JS_PROMISE_TYPE");
kHeapNumberType = LoadConstant("type_HeapNumber__HEAP_NUMBER_TYPE");
kMapType = LoadConstant("type_Map__MAP_TYPE");
kGlobalObjectType =
Expand Down
1 change: 1 addition & 0 deletions src/llv8-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ class Types : public Module {
int64_t kLastContextType;

int64_t kJSErrorType;
int64_t kJSPromiseType;
int64_t kHeapNumberType;
int64_t kMapType;
int64_t kGlobalObjectType;
Expand Down
1 change: 1 addition & 0 deletions src/llv8-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ inline bool JSObject::IsObjectType(LLV8* v8, int64_t type) {
return type == v8->types()->kJSObjectType ||
type == v8->types()->kJSAPIObjectType ||
type == v8->types()->kJSErrorType ||
type == v8->types()->kJSPromiseType ||
type == v8->types()->kJSSpecialAPIObjectType;
}

Expand Down

0 comments on commit 267cb15

Please sign in to comment.