[jsinterp] Handle Date at epoch 0

See yt-dlp/yt_dlp#6400
This commit is contained in:
pukkandan
2023-03-03 16:48:54 +05:30
committed by dirkf
parent 3da17834a4
commit 3e92c60fcd
2 changed files with 5 additions and 1 deletions

View File

@ -405,7 +405,7 @@ class JSInterpreter(object):
left, right = self._separate_at_paren(obj[len(klass):])
argvals = self.interpret_iter(left, local_vars, allow_recursion)
expr = konstr(*argvals)
if not expr:
if expr is None:
raise self.Exception('Failed to parse {klass} {left!r:.100}'.format(**locals()), expr=expr)
expr = self._dump(expr, local_vars) + right
break