Skip to content

Instantly share code, notes, and snippets.

@subzey
Created June 25, 2018 17:11
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 subzey/101ab3fd4ace9ec44859b5e04e47c1ed to your computer and use it in GitHub Desktop.
Save subzey/101ab3fd4ace9ec44859b5e04e47c1ed to your computer and use it in GitHub Desktop.
jq 1.7 cache leak
<!doctype html>
<html>
<head>
<title>jQuery 1.7.2 cache leak</title>
</head>
<body>
<script src="https://code.jquery.com/jquery-1.7.2.min.js" crossorigin="anonymous"></script>
<script>
(function(){
var leaky = new function Leaky(){};
$('<div>')
.on('click', function(){ void leaky; })
;
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment