-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers
Description
Example: it's not really documented anywhere that JS_SetProperty(ctx, obj, key, val) takes ownership of val but not key. One must call JS_FreeAtom(ctx, key) afterwards but not JS_FreeValue(ctx, val).
Another example of an undocumented constraint: you should not JS_FreeValue the elements of the argv array to your C callback. But you should JS_FreeValue the return value of JS_GetProperty(ctx, obj, key). Here too, one must JS_FreeAtom(ctx, key).
Neither is it documented that the first length elements of argv are valid (set to undefined) when JS calls a C function with too few arguments. Or that argc can be greater than length - which makes perfect sense but is undocumented.
Should probably go into docs/docs/developer-guide/api.md?
past-due
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationgood first issueGood for newcomersGood for newcomers