Similar legislation in Canada has drawn opposition from the pro-Palestinian left and pro-Israel right.