Scotland’s assisted dying legislation has passed its first legislative hurdle after MSPs voted in favour of the general principles of the law.