News for hackers. Stuff that matters.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by riffraff on Monday March 31, 2014 @04:19PM (#7503853)
is it? "null" is not valid python, I think
Re:Evil.js: A JavaScript library for thwarting hot-linkers by wisty on Tuesday April 01, 2014 @03:13AM (#7506612)
If you do this first:

    null = None
    Infinity = float('Infinity')
    NaN = float('nan')
(But no, it's not quite Python)
Re:Evil.js: A JavaScript library for thwarting hot-linkers by mercurial on Monday March 31, 2014 @04:52PM (#7504073)
It isn't. It would be None. I believe parent is mistaken.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by hrjet on Monday March 31, 2014 @11:35PM (#7506028)
I stand corrected; I am not that familiar with python. Though I remember reading somewhere that JSON can be evaled in both JS and Python. Perhaps the python bit is not true.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by kibibu on Monday March 31, 2014 @11:50PM (#7506082)
JSON looks more-or-less like a Python dict, but you still wouldn't be able to parse {"x": NaN} or {"x": Infinity}
Re:Evil.js: A JavaScript library for thwarting hot-linkers by derefr on Tuesday April 01, 2014 @12:47AM (#7506225)
Oddly, there's actually no language that I know of that has NaN and Infinity constants. Many languages pretty-print those float values that way, but none of the parsers can interpret them back in.
Re:Evil.js: A JavaScript library for thwarting hot-linkers by GeneralMayhem on Tuesday April 01, 2014 @01:56AM (#7506424)
...do you mean other than JavaScript? They're not actually parser-level constants, they're just defined as globals/on the window object, but they work.