V8 proxy ReferenceError

I try to use ES6 Proxy in version 8 (version 4.6.85.31), but I get ReferenceError: Proxy is not defined (I use v8 from golang)

I also tried the same in node.js 5.1.0 with the -harmony-proxies flag and supported proxies (same version v8)

But how can I use proxies directly in v8? Do I need to compile it with some flags?

Thanks!

+5
source share
1 answer

For those who received the same question, you can use

 std::string flags("--harmony_proxies"); V8::SetFlagsFromString(flags.c_str(), flags.length()); 

Also see node --v8-options for a complete list of v8 options, a lot of interesting node --v8-options !

for example, I also needed the --expose_gc flag to debug v8 garbage collection

+7
source

Source: https://habr.com/ru/post/1239073/


All Articles