Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DmitrySoshnikov
Created September 14, 2010 08:19
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 DmitrySoshnikov/578708 to your computer and use it in GitHub Desktop.
Save DmitrySoshnikov/578708 to your computer and use it in GitHub Desktop.
// Latest Firefox (including nightly):
// INCORRECT with FDs
(function () {
// a function declaration
// does not replace arguments object
function arguments() {}
alert(arguments); // "[object Object]", should be function
// nor even if to assign a new value then
arguments = 10;
alert(arguments); // "[object Object]", should be 10
})(1);
// CORRECT with vars
// However, if we have a variable declaration
// with later assignment, it's OK
(function () {
// a variable declaration
// correctly does not disturb
// arguments object
var arguments;
alert(arguments); // OK, "[object Object]"
// and its assignment again correctly does
arguments = 10;
alert(arguments); // 10
})(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment