Created
July 4, 2014 04:56
-
-
Save hisasann/9438007d88f99ef5a2e7 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
function func1(b) { | |
func2(); | |
console.log(b); // IEではfalse | |
} | |
function func2(fn) { | |
arguments.callee.caller.arguments[0] = false; // 破壊した! | |
} | |
func1(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment