News for hackers. Stuff that matters.
Re:153k Ether Stolen in Parity Multi-Sig Attack by vazhifarer on Thursday July 20, 2017 @12:53AM (#14810082)
> Scoping rules are inherited from JS, meaning that you can declare variables inside blocks, but their scope is always the enclosing function

That's not still the case with `const` and `let` in Javascript, is it? Lexical scoping still exists, but Block scoping is default now in JS

Re:153k Ether Stolen in Parity Multi-Sig Attack by MaxfordAndSons on Thursday July 20, 2017 @01:09AM (#14810138)
> Block scoping is default now in JS

The default best practice, you mean? Declaring with 'var' will still get you the same lexical scoping rules as always.

I believe OP meant 'inherited from pre-ES6 JS'

Re:153k Ether Stolen in Parity Multi-Sig Attack by positivecomment on Thursday July 20, 2017 @08:02AM (#14811682)
I thought using "var" is deprecated... If there's anyone who has the chance to use let/const but still doesn't, I'd be very curious to learn about their reasoning
Re:153k Ether Stolen in Parity Multi-Sig Attack by seangrogg on Thursday July 20, 2017 @11:54AM (#14813560)
Bad habits, arguably. Been using JS for years so occasionally instances where a more vigilant self would use "let" still get "var" instead. I think part of this is because of issues with previous versions of v8/node where using let at the global level or without 'use strict' threw errors.

That being said, "const" is already hardwired.

Re:153k Ether Stolen in Parity Multi-Sig Attack by vazhifarer on Thursday July 20, 2017 @02:11PM (#14814947)
I know right. Principle of least Privilege. Simple.
Re:153k Ether Stolen in Parity Multi-Sig Attack by hippich on Thursday July 20, 2017 @12:54PM (#14814186)
to get variable defined in function scope? :)