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 722286 - ByteArray: don't call eval() just to retrieve a prototype
ByteArray: don't call eval() just to retrieve a prototype
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-15 18:46 UTC by Giovanni Campagna
Modified: 2014-01-15 21:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ByteArray: don't call eval() just to retrieve a prototype (3.98 KB, patch)
2014-01-15 18:46 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2014-01-15 18:46:13 UTC
If using a global variable to store ByteArray.prototype is wrong,
we can use a slot on the global object. Also, while we're there
we can rewrite the JS import code in terms of JSAPI calls.
Comment 1 Giovanni Campagna 2014-01-15 18:46:15 UTC
Created attachment 266377 [details] [review]
ByteArray: don't call eval() just to retrieve a prototype
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-01-15 19:24:14 UTC
Review of attachment 266377 [details] [review]:

If we only do this once per context, because of the global slot, I don't think the eval(); will hurt us here, so I'd like to keep it for readability.
Comment 3 Giovanni Campagna 2014-01-15 21:45:03 UTC
Pushed after addressing comments.

Attachment 266377 [details] pushed as 5b7c1d3 - ByteArray: don't call eval() just to retrieve a prototype