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 770111 - Format: be future proof against fixes in SpiderMonkey
Format: be future proof against fixes in SpiderMonkey
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2016-08-18 20:19 UTC by Giovanni Campagna
Modified: 2016-08-19 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Format: be future proof against fixes in SpiderMonkey (1.21 KB, patch)
2016-08-18 20:19 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2016-08-18 20:19:40 UTC
Modern JS engines (in Firefox and Chrome, as well as node) pass
undefined, not '', to the replaced function for groups that are not matched.
Be future proof against changes that might go unnoticed when
porting to SpiderMonkey 31/38/45/whatever that will be, and also
if people extract this code and use it against different engines.

(At least SM 34 has the right behavior, not sure about 31)
Comment 1 Giovanni Campagna 2016-08-18 20:19:43 UTC
Created attachment 333588 [details] [review]
Format: be future proof against fixes in SpiderMonkey
Comment 2 Cosimo Cecchi 2016-08-19 08:29:35 UTC
Review of attachment 333588 [details] [review]:

Looks good to me, thanks.
Comment 3 Giovanni Campagna 2016-08-19 18:42:30 UTC
Attachment 333588 [details] pushed as 2cf42c5 - Format: be future proof against fixes in SpiderMonkey