[jsinterp] 'reverse' modifies the array in place (fixes #3334)
parent
825abb8175
commit
ebe832dc37
|
@ -62,7 +62,13 @@ _TESTS = [
|
||||||
u'js',
|
u'js',
|
||||||
84,
|
84,
|
||||||
u'123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ0STUVWXYZ!"#$%&\'()*+,@./:;<=>'
|
u'123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQ0STUVWXYZ!"#$%&\'()*+,@./:;<=>'
|
||||||
)
|
),
|
||||||
|
(
|
||||||
|
u'https://s.ytimg.com/yts/jsbin/html5player-en_US-vfl9FYC6l.js',
|
||||||
|
u'js',
|
||||||
|
83,
|
||||||
|
u'123456789abcdefghijklmnopqr0tuvwxyzABCDETGHIJKLMNOPQRS>UVWXYZ!"#$%&\'()*+,-./:;<=F'
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,8 @@ class JSInterpreter(object):
|
||||||
return argvals[0].join(obj)
|
return argvals[0].join(obj)
|
||||||
if member == 'reverse':
|
if member == 'reverse':
|
||||||
assert len(argvals) == 0
|
assert len(argvals) == 0
|
||||||
return obj[::-1]
|
obj.reverse()
|
||||||
|
return obj
|
||||||
if member == 'slice':
|
if member == 'slice':
|
||||||
assert len(argvals) == 1
|
assert len(argvals) == 1
|
||||||
return obj[argvals[0]:]
|
return obj[argvals[0]:]
|
||||||
|
|
Loading…
Reference in New Issue