emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.74k stars 3.3k forks source link

webidl: Why remove the underline of a variable or function #12495

Open ucanudo opened 4 years ago

ucanudo commented 4 years ago

image

class Test{ public: Test(); ~Test(); void _getInnerData(){ return _innerData; } double _innerData; } webidl will remov '_' . convert '_getInnerData()' to 'getInnerData()', convert '_innerData' to 'innerData'. why???

kripken commented 4 years ago

I think that's in the WebIDL parser code that we didn't write (which is 99% of it). I'm not familiar enough with WebIDL to know if prefixes like that matter, but that code was taken from Mozilla's codebase, so it's probably right.

ucanudo commented 4 years ago

I think that's in the WebIDL parser code that we didn't write (which is 99% of it). I'm not familiar enough with WebIDL to know if prefixes like that matter, but that code was taken from Mozilla's codebase, so it's probably right.

Thank you very much. What's the difference between webidl in Emscripten and this site (https://heycam.github.io/webidl/), Why are some keywords not recognized? Does the file 'webidl.py' is too old?

kripken commented 4 years ago

Yes, it's probably just that we took that code many years ago, and have not updated. In practice just a subset of WebIDL matters, which is why it wasn't urgent to update. Is something missing?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.