News for hackers. Stuff that matters.
Re:A one-line package broke `npm create-react-app` by jcelerier on Saturday April 25, 2020 @01:38PM (#22979719)
how does that make sense in any universe. Just because I have a function named "then" does not mean that my object is a promise. Maybe "then" is the name of a domain thing in my project, for instance a small DSL or something like that. arghhhhhh !
Re:A one-line package broke `npm create-react-app` by jhanschoo on Saturday April 25, 2020 @03:30PM (#22980677)
objects with a .then(...) methods are treated as though they have Promise semantics by the language

See Promise.resolve https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re:A one-line package broke `npm create-react-app` by LudwigNagasena on Saturday April 25, 2020 @03:40PM (#22980764)
Consider it a special function like "__init__" in Python. I think this is one of the problems with duck typing, existence of a public function introduces possible name collision onto the whole codebase.
Re:A one-line package broke `npm create-react-app` by krapp on Saturday April 25, 2020 @01:45PM (#22979760)
It's almost as if treating a dynamically typed interpreted language as if it had static types like C++ is fundamentally broken.