diff --git a/srcpkgs/mozjs24/patches/perl522.patch b/srcpkgs/mozjs24/patches/perl522.patch
new file mode 100644
index 00000000000..d383d98a779
--- /dev/null
+++ b/srcpkgs/mozjs24/patches/perl522.patch
@@ -0,0 +1,11 @@
+--- js/src/config/milestone.pl.orig
++++ js/src/config/milestone.pl
+@@ -56,7 +56,7 @@
+ #
+ my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
+ 
+-if (defined(@TEMPLATE_FILE)) {
++if (@TEMPLATE_FILE) {
+   my $TFILE;
+ 
+   foreach $TFILE (@TEMPLATE_FILE) {
diff --git a/srcpkgs/mozjs24/template b/srcpkgs/mozjs24/template
index 8a141a6c9f1..a477157bc5c 100644
--- a/srcpkgs/mozjs24/template
+++ b/srcpkgs/mozjs24/template
@@ -1,7 +1,7 @@
 # Template file for 'mozjs24'
 pkgname=mozjs24
 version=24.2.0
-revision=3
+revision=4
 wrksrc="mozjs-${version}"
 build_wrksrc="js/src"
 build_style=gnu-configure