[jsinterp] 'reverse' modifies the array in place (fixes #3334)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 24 Jul 2014 09:08:31 +0000 (11:08 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Thu, 24 Jul 2014 09:08:31 +0000 (11:08 +0200)
test/test_youtube_signature.py
youtube_dl/jsinterp.py

index f0f33f1db2643b6eeb1c4b82202e071c40f826fb..8f1afd4321ba093c3892b9c9a61a8ed44210c305 100644 (file)
@@ -62,7 +62,13 @@ _TESTS = [
         u'js',
         84,
         u'123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ0STUVWXYZ!"#$%&\'()*+,@./:;<=>'
-    )
+    ),
+    (
+        u'https://s.ytimg.com/yts/jsbin/html5player-en_US-vfl9FYC6l.js',
+        u'js',
+        83,
+        u'123456789abcdefghijklmnopqr0tuvwxyzABCDETGHIJKLMNOPQRS>UVWXYZ!"#$%&\'()*+,-./:;<=F'
+    ),
 ]
 
 
index 34e5307faeda30f7f7fb560c8d84027777e17a7b..95e6948ff3ab518e6cd36f9e7423d1cc71cb5785 100644 (file)
@@ -98,7 +98,8 @@ class JSInterpreter(object):
                 return argvals[0].join(obj)
             if member == 'reverse':
                 assert len(argvals) == 0
-                return obj[::-1]
+                obj.reverse()
+                return obj
             if member == 'slice':
                 assert len(argvals) == 1
                 return obj[argvals[0]:]