News for hackers. Stuff that matters.
Re:Compiler Warnings by loeg on Friday January 25, 2019 @11:15AM (#18999278)
> I believe I have also seen this behaviour come up with interning on some Integer wrapper types.

Python, for example:

  >>> 8 is 8
  True
  >>> 8**1000 is 8**1000
  False
Re:Compiler Warnings by olliej on Friday January 25, 2019 @02:21PM (#19001438)
Because python is broken in this respect -- JS engines do exactly the same object optimisations and get comparisons correct.
Re:Compiler Warnings by loeg on Friday January 25, 2019 @03:29PM (#19002191)
Meh. They're different languages with different expectations. "is" is distinct from "==" in both, and Python gets "==" right (obviously). Javascript doesn't really have any high ground here[0]. (In contrast, Python:)

  >>> [] == False
  False
  >>> object() == False
  False
  >>> "" == False
  False
  >>> {} == False
  False
They're just different.

[0]: https://www.youtube.com/watch?v=et8xNAc2ic8

Re:Compiler Warnings by viraptor on Friday January 25, 2019 @09:59PM (#19004491)
JS has "strict equality" comparison. It's not the same as "identity" comparison.