Skip to content

Instantly share code, notes, and snippets.

@also
Created March 9, 2017 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save also/939a7380bbbff341bf894783c48ad90b to your computer and use it in GitHub Desktop.
Save also/939a7380bbbff341bf894783c48ad90b to your computer and use it in GitHub Desktop.
var reassign = loadWithNewGlobal({
script: '(function (o, i) { o[i] = o[i]; })',
name: 'test.js'
});
function test(i) {
var o = {};
o[i] = true;
reassign(o, i);
print(JSON.stringify(o));
}
test(-2147483648); // {"-2147483648":null}
test(-2147483647); // {"-2147483647":true}
test(2147483647); // {"2147483647":true}
test(2147483648); // {"2147483648":true,"-1":null}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment