weixin_39639505
weixin_39639505
2021-01-06 21:42

Should Observable.from use a brand check to confirm argument is Observable

Observable.from currently only checks that the constructor property of the input is equal to the the this object of Observable.from. This seems easy to spoof. It's straightforward to create an object with a constructor property equal to the Observable constructor that does not contain a subscribe method or otherwise behave like an Observable. Should we use a brand check to confirm that the input to Observable.from is indeed a species of Observable?

该提问来源于开源项目:tc39/proposal-observable

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

16条回答

为你推荐

换一换