Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "harmony-reflect" aka Proxy() in main.js? *How to enable --harmony_proxies flag? #3352

Closed
skhameneh opened this issue Nov 5, 2015 · 7 comments

Comments

@skhameneh
Copy link
Contributor

I've tried the following:

var v8 = require('v8')
v8.setFlagsFromString('--harmony_proxies');
app.commandLine.appendSwitch('js-flags', '--harmony_proxies');
app.on('ready', function() {
    app.commandLine.appendSwitch('js-flags', '--harmony_proxies');
}

and starting electron with:
electron . --js-flags="--harmony_proxies"
electron . --harmony_proxies

None of these seem to work and it's failing inside require('harmony-reflect') when checking for Proxy.
How can I enable ES6 Proxies?

Using:
Node.js v4.1.1
Electron 0.34.1.

@skhameneh
Copy link
Contributor Author

More version info:
ares: "1.10.1-DEV"
atom-shell: "0.34.1"
chrome: "45.0.2454.85"
electron: "0.34.1"
http_parser: "2.5.0"
modules: "46"
node: "4.1.1"
openssl: "1.0.2d"
uv: "1.7.4"
v8: "4.5.103.29"
zlib: "1.2.8"

@OlsonDev
Copy link

OlsonDev commented Nov 6, 2015

Not sure if it makes a difference but try --harmony-proxies instead?

https://code.google.com/p/v8/issues/detail?id=1543#c45

@skhameneh
Copy link
Contributor Author

@OlsonDev No difference, I'm able to get it working in the render view with the previous mention, but not in the main thread.

@zcbenz
Copy link
Member

zcbenz commented Nov 6, 2015

This flag has to be setup before the JavaScript context is created, so v8.setFlagsFromString won't work. We should probably add support for --js-flags command line switch.

@skhameneh
Copy link
Contributor Author

That would be ideal, in the meantime I have tried changing the default flags for v8 in flag-definitions.h with no success (clean, compile, run) and proxies still aren't enabled. Any suggestions?

Could my existing electron install be interfering?

I'm compiling another build w/ more harmony flags enabled to see if this makes a difference.

@skhameneh
Copy link
Contributor Author

I've made numerous changes and build attempts to both files for Atom, Node, and V8. None of my changes have successfully enabled proxies. I've also found the vendor source for Node is not the same as the actual source for Node v4.1.1, what is the reason for this? Due to this inconsistency I'm unable to build the same sources for Node nor am I able to replace the vendor Node with the official Node sources.

  • I can force enable harmony proxies (via code changes) in the official Node v4.1.1 and it works.
  • The Electron vendor of Node is different that the official Node v4.1.1 and does not compile standalone.
  • I have made changes to Electron, Node, and V8 - none of which seem to work for enabling harmony proxies in Electron.

Are Harmony features broken in Electron's version of Node?

@zcbenz
Copy link
Member

zcbenz commented Nov 16, 2015

Closed with #3412.

@zcbenz zcbenz closed this as completed Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants