After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595323 - Add "system" module which has a binding "gc"
Add "system" module which has a binding "gc"
Status: RESOLVED WONTFIX
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
: 593215 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-15 23:57 UTC by Colin Walters
Modified: 2010-01-25 22:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add "system" module which has a binding "gc" (5.50 KB, patch)
2009-09-15 23:57 UTC, Colin Walters
none Details | Review
Add "system" module which has "gc" and "addressOf" (1.52 KB, patch)
2009-09-23 20:12 UTC, Colin Walters
none Details | Review
Add "system" module which has "gc" and "addressOf" (6.20 KB, patch)
2009-09-23 20:26 UTC, Colin Walters
none Details | Review

Description Colin Walters 2009-09-15 23:57:05 UTC
It's very convenient to be able to initiate garbage collection
from a JS context.  In the future I could imagine other stuff in
this module roughly along the lines of Java's "System", but for
now just GC.
Comment 1 Colin Walters 2009-09-15 23:57:07 UTC
Created attachment 143255 [details] [review]
Add "system" module which has a binding "gc"
Comment 2 Johan Bilien 2009-09-16 00:22:36 UTC
Hmm isn't this the same as bug# 593215 ?
Comment 3 Colin Walters 2009-09-16 00:26:24 UTC
Oops, yes...let's dup that one on this.
Comment 4 Colin Walters 2009-09-16 00:26:25 UTC
*** Bug 593215 has been marked as a duplicate of this bug. ***
Comment 5 Colin Walters 2009-09-23 20:12:57 UTC
Created attachment 143828 [details] [review]
Add "system" module which has "gc" and "addressOf"

"gc": It's very convenient to be able to initiate garbage collection
from a JS context.

"addressOf" is mainly going to be useful for printf debugging; i.e.
being able to answer "Ok, what [Object object] is this"?
Comment 6 Johan Bilien 2009-09-23 20:16:21 UTC
You forgot to add the files, the patch is only Makefile changes
Comment 7 Colin Walters 2009-09-23 20:25:41 UTC
(In reply to comment #6)
> You forgot to add the files, the patch is only Makefile changes

I had to leave something as an exercise for the reader... =)
Comment 8 Colin Walters 2009-09-23 20:26:05 UTC
Created attachment 143833 [details] [review]
Add "system" module which has "gc" and "addressOf"

"gc": It's very convenient to be able to initiate garbage collection
from a JS context.

"addressOf" is mainly going to be useful for printf debugging; i.e.
being able to answer "Ok, what [Object object] is this"?
Comment 9 Johan Bilien 2009-09-23 20:33:18 UTC
+    if (!JS_DefineFunction(context, module_obj,
+                           "gc",
+                           gjs_jssystem_gc,
+                           1, GJS_MODULE_PROP_FLAGS))

Should be 0 I believe


The style is not consistent, the function implementation should use an indentation of 4 spaces

Looks to me otherwise
Comment 10 Tommi Komulainen 2009-09-23 20:36:34 UTC
Comment on attachment 143833 [details] [review]
Add "system" module which has "gc" and "addressOf"

>+system_la_LIBADD = \
>+    libgjs-gi.la                \
>+    $(JS_NATIVE_MODULE_LIBADD)

libgjs-gi shouldn't be needed if the module doesn't use introspection. Isn't libgjs.la enough?
Comment 11 Colin Walters 2010-01-25 22:49:29 UTC
Let's skip this for now, I don't want to add highlevel imports at random.  It was easier for me to just define it inside Shell.

We should look to Common JS for module inspirations if someone wants to revisit adding a System module like.