Reproduced from typescript.