[quickjs-devel] Re: Read Only Property, that C code can modify, but JS code can't

  • From: Connor Nolan <connor24nolan@xxxxxxxx>
  • To: "quickjs-devel@xxxxxxxxxxxxx" <quickjs-devel@xxxxxxxxxxxxx>
  • Date: Thu, 8 Aug 2019 15:50:07 +0000

Also, how exactly would you use JS_SetOpaque/JS_GetOpaque to create for example 
the "readyState" property of XMLHttpRequest? Or, was JS_SetOpaque/JS_GetOpaque 
part of the second half of my question, about properties only visible to C?

________________________________
From: quickjs-devel-bounce@xxxxxxxxxxxxx <quickjs-devel-bounce@xxxxxxxxxxxxx> 
on behalf of Connor Nolan <connor24nolan@xxxxxxxx>
Sent: Thursday, August 8, 2019 7:33 AM
To: quickjs-devel@xxxxxxxxxxxxx <quickjs-devel@xxxxxxxxxxxxx>
Subject: [quickjs-devel] Re: Read Only Property, that C code can modify, but JS 
code can't

Anyway to make a property only visible to C code?

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: quickjs-devel-bounce@xxxxxxxxxxxxx <quickjs-devel-bounce@xxxxxxxxxxxxx> 
on behalf of Sam Chang <dmarc-noreply@xxxxxxxxxxxxx>
Sent: Wednesday, August 7, 2019 11:05:04 PM
To: quickjs-devel@xxxxxxxxxxxxx <quickjs-devel@xxxxxxxxxxxxx>
Subject: [quickjs-devel] Re: Read Only Property, that C code can modify, but JS 
code can't

have a try JS_SetOpaque/JS_GetOpaque

On Aug 8, 2019, at 2:50 AM, Connor Nolan 
<connor24nolan@xxxxxxxx<mailto:connor24nolan@xxxxxxxx>> wrote:

Is it possible to create a read only property that C code can modify, but JS 
can't, and that cant be overridden by Object.defineProperty()? Also is it 
possible to give an object a hidden property that is only accessible from C 
code?

Other related posts: