Fix splice to handle float

Needed for new youtube js player f1ca6900
Add 57dbe8077f (diff-729b57caa8d006426f6a8960c061f519a8b6658682284015e069745af52ffb07)
pull/30577/head
dirkf 3 years ago
parent e1eae16b56
commit 1ca673bd98

@ -416,7 +416,7 @@ class JSInterpreter(object):
elif member == 'splice':
assertion(isinstance(obj, list), 'must be applied on a list')
assertion(argvals, 'takes one or more arguments')
index, howMany = (argvals + [len(obj)])[:2]
index, howMany = map(int, (argvals + [len(obj)])[:2])
if index < 0:
index += len(obj)
add_items = argvals[2:]

Loading…
Cancel
Save