bellard / quickjs

Public repository of the QuickJS Javascript Engine.
https://bellard.org/quickjs
Other
8.55k stars 895 forks source link

Fix termination in Worker test #336

Closed akosthekiss closed 4 months ago

akosthekiss commented 4 months ago

Function names are case sensitive, onMessage is not the same as onmessage.

Related to #98

chqrlie commented 4 months ago

While I approve this fix for consistency reasons, as onmessage is used in quickjs-libc.c, the spelling seems inconsistent with the rest of the API and at least one reputable source uses onMessage: I personally have never used these extensions, can someone explain the difference?

akosthekiss commented 4 months ago

@chqrlie As far as I know, the Worker API of QuickJS is based on the Web Worker API (https://github.com/bellard/quickjs/blob/master/doc/quickjs.texi#L813). According to the HTML Living Standard (https://html.spec.whatwg.org/#workers), workers have onmessage (all lower case) and postMessage (camel case).