Skip to content

Commit

Permalink
fix: fix JsPropertyDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
LazuliKao committed Aug 2, 2023
1 parent 01a7718 commit 80b9329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Modules/Clr/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ JsAtom propName
{ //todo fix this
data = new JsPropertyDescriptor
{
Flags = JsPropertyFlags.HasGet,
Getter = ctxInstance
Flags = JsPropertyFlags.HasValue,
Value = ctxInstance
.NewJsFunctionObject(
(_, thisObj, argv) =>
{
Expand Down
8 changes: 4 additions & 4 deletions src/QuickJS/Types/JsPropertyDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Hosihikari.VanillaScript.QuickJS.Types;

[StructLayout(LayoutKind.Explicit, Size = 16 * 4)]
[StructLayout(LayoutKind.Explicit, Size = 16 * 3 + 8)]
public ref struct JsPropertyDescriptor
{
/*
Expand All @@ -17,12 +17,12 @@ typedef struct JSPropertyDescriptor {
public JsPropertyFlags Flags;

//ref to js_free_desc(__int64 a1, _QWORD *a2)
[FieldOffset(16)]
[FieldOffset(8)]
public JsValue Value;

[FieldOffset(2 * 16)]
[FieldOffset(8 + 16)]
public JsValue Getter;

[FieldOffset(3 * 16)]
[FieldOffset(8 + 16 + 16)]
public JsValue Setter;
}

0 comments on commit 80b9329

Please sign in to comment.