Skip to content

Instantly share code, notes, and snippets.

@patrickkettner
Last active February 15, 2017 09:24
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 patrickkettner/8825ff8411063ac0d40cd27f8d188f65 to your computer and use it in GitHub Desktop.
Save patrickkettner/8825ff8411063ac0d40cd27f8d188f65 to your computer and use it in GitHub Desktop.
Chrome Bug(?)

live demo here

all browsers (except chrome) throw when the .caller of .caller is accessed on line 18

<!DOCTYPE HTML>
<html>
<head>
<title>Chrome Bug?</title>
<script>
function A() {
"use strict";
B();
}
function B() {
eval('C.call();');
};
function C() {
document.documentElement.style.backgroundColor = 'green';
C.caller.caller
document.documentElement.style.backgroundColor = 'red';
}
A()
</script>
</head>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment