Last active
August 28, 2018 09:49
-
-
Save chee/ece8272550e09f312a23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bizarguments is a v8 anomaly | |
function abc() { | |
return def(); | |
} | |
function def() { | |
return abc.arguments[0] * 2; | |
} | |
abc(50); // >> 100 | |
// so that's weird enough but: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(arg) { | |
bar(); | |
console.log(arg); | |
} | |
function bar() { | |
foo.arguments[0] = "lol"; | |
} | |
foo("hello") // prints "hello" | |
// alright, so you can't edit the arguments up the stack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo(arg) { | |
bar(); | |
// this line is the only thing that changes: | |
console.log(arg, arguments[0]); | |
} | |
function bar() { | |
foo.arguments[0] = "lol"; | |
} | |
foo("hello") // prints "lol" "lol" | |
// wait what | |
// wait what twice |
chrisdickinson
commented
May 6, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment