Skip to content

Commit 2cd3c8e

Browse files
committed
expose symbol.description so that we can print the actual symbol value
1 parent 01180f7 commit 2cd3c8e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/binding.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,6 +1514,9 @@ const v8::Symbol* v8__Symbol__GetToStringTag(v8::Isolate* isolate) {
15141514
const v8::Symbol* v8__Symbol__GetUnscopables(v8::Isolate* isolate) {
15151515
return local_to_ptr(v8::Symbol::GetUnscopables(isolate));
15161516
}
1517+
const v8::Value* v8__Symbol__Description(const v8::Symbol& self, v8::Isolate* isolate) {
1518+
return local_to_ptr(self.Description(isolate));
1519+
}
15171520

15181521
// Persistent
15191522

src/binding.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ const Symbol* v8__Symbol__GetSplit(Isolate* isolate);
828828
const Symbol* v8__Symbol__GetToPrimitive(Isolate* isolate);
829829
const Symbol* v8__Symbol__GetToStringTag(Isolate* isolate);
830830
const Symbol* v8__Symbol__GetUnscopables(Isolate* isolate);
831+
const Value* v8__Symbol__Description(const Symbol* self, Isolate* isolate);
831832

832833
// Persistent
833834
typedef struct Persistent {

src/v8.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,12 @@ pub const Symbol = struct {
14031403
.handle = c.v8__Symbol__GetUnscopables(isolate.handle).?,
14041404
};
14051405
}
1406+
1407+
pub fn getDescription(self: Symbol, isolate: Isolate) Value {
1408+
return .{
1409+
.handle = c.v8__Symbol__Description(self.handle, isolate.handle).?,
1410+
};
1411+
}
14061412
};
14071413

14081414
pub const Number = struct {

0 commit comments

Comments
 (0)