webidl binder: define properties with JS accessors (#7298)

Currently C++ class and struct properties are defined in JavaScript bindings with get_foo and set_foo accessor methods. This PR adds support for directly accessing the properties using native JS accessors. For example:

// Current way
myObject.set_foo(1);
console.log(myObject.get_foo());

// After this PR:
myObject.foo = 1;
console.log(myObject.foo);

This is more idiomatic JavaScript, and means that the bindings match the IDL correctly. I have left the existing getters and setters in place, so this is be backward-compatible.
10 files changed
tree: e17e470703b78c4e0fbba492a696a32fd83c804e
  1. .circleci/
  2. cmake/
  3. docs/
  4. media/
  5. site/
  6. src/
  7. system/
  8. tests/
  9. third_party/
  10. tools/
  11. .clang-format
  12. .flake8
  13. .gitattributes
  14. .gitignore
  15. .style.yapf
  16. .travis.yml
  17. AUTHORS
  18. ChangeLog.md
  19. CONTRIBUTING.md
  20. Dockerfile
  21. em++
  22. em++.bat
  23. em++.py
  24. em-config
  25. em-config.bat
  26. emar
  27. emar.bat
  28. emar.py
  29. embuilder.py
  30. emcc
  31. emcc.bat
  32. emcc.py
  33. emcmake
  34. emcmake.bat
  35. emcmake.py
  36. emconfigure
  37. emconfigure.bat
  38. emconfigure.py
  39. emlink.py
  40. emmake
  41. emmake.bat
  42. emmake.py
  43. emranlib
  44. emranlib.bat
  45. emrun
  46. emrun.bat
  47. emrun.py
  48. emscons
  49. emscons.py
  50. emscripten-version.txt
  51. emscripten.py
  52. LICENSE
  53. package.json
  54. README.md
README.md

emscripten logo

Build Status CircleCI

Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated from C/C++, using llvm-gcc (DragonEgg) or clang, or any other language that can be converted into LLVM - and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).

Links to demos, tutorial, FAQ, etc: https://github.com/kripken/emscripten/wiki

Main project page: http://emscripten.org

License

Emscripten is available under 2 licenses, the MIT license and the University of Illinois/NCSA Open Source License.

Both are permissive open source licenses, with little if any practical difference between them.

The reason for offering both is that (1) the MIT license is well-known, while (2) the University of Illinois/NCSA Open Source License allows Emscripten's code to be integrated upstream into LLVM, which uses that license, should the opportunity arise.

See LICENSE for the full content of the licenses.