How to use DefineAccessorProperty #438
Unanswered
qazwsxedckll
asked this question in
Q&A
Replies: 1 comment
-
Sorry, I don't understand exactly what you're trying to achieve. The setter return value is ignored, you can simply return nil. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What I am trying to do is when property of an object is accessed in javascript, some value in go can be returned and when the property is assigned in javascript, the value in go can be changed.
The go value is very complicated so ToValue() does not work.
So I wrote something like
But
getPropertyValue
andsetPropertyValue
cannot get the name of the property which iskey
orthis
in javascript.Something like this in v8
Or maybe
Proxy
can do the job?This is my final result
Is this how it supposed to use?
Is it right to return goja.Null() in
func setter
?Beta Was this translation helpful? Give feedback.
All reactions