Yes , with var k its works :-)

Any idea how i can get properties of const / let ?
Which object hold them ? 
i try to retrieve from context without succeess 
 
Thanks a lot 
Oren 

On Friday, July 3, 2020 at 5:56:54 PM UTC+3, Marja Hölttä wrote:
>
> "const" doesn't define a property in the global object. Does it work if 
> you use "var K" instead of "const K"?
>
>
> On Fri, Jul 3, 2020, 12:02 <[email protected] <javascript:>> wrote:
>
>> I compile & run this string  "const K = {a: 1, b: 2}; "
>>>> But when I try to get properties of object K  ,  I got *undefined *at 
>>>> val_k , Any idea why ?
>>>>
>>>> v8::Local<v8::Object> global_obj = m_Context->Global();
>>>> Local<Value> val_k = global_obj->Get(m_Context, 
>>>> v8::String::NewFromUtf8(m_Isolate, "K")).ToLocalChecked();
>>>>
>>>> Attached sample that reproduce it 
>>>>
>>>> Thanks 
>>>> Oren  
>>>>
>>> -- 
>> -- 
>> v8-dev mailing list
>> [email protected] <javascript:>
>> http://groups.google.com/group/v8-dev
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "v8-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/v8-dev/5610ff0d-acc1-4d95-9b91-272301386307o%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/v8-dev/5610ff0d-acc1-4d95-9b91-272301386307o%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/abcefcd3-41a0-4690-9c8f-577d8a7bf525o%40googlegroups.com.

Reply via email to