Skip to content

Instantly share code, notes, and snippets.

@ConradIrwin
Created January 13, 2014 07:00
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 ConradIrwin/8395802 to your computer and use it in GitHub Desktop.
Save ConradIrwin/8395802 to your computer and use it in GitHub Desktop.
<script>
window.onerror = function () {
console.log(arguments);
};
</script>
<script>
(function () {
(function () {
try {
(1 + 1, atob());
} catch (e) {
alert(e.stack);
}
})();
})();
</script>
<script>
throw new Error"hmorning");
</script>
<pre>
// e.g. 1
"foo"; throw new Error("moo");
123456789'123456789"123456789#123456
Chrome: 20 index of 'new'
Safari: 36 index of ';'
IE : 14 index of 'throw'
FF : 20 index of 'new'
// e.g 2
alert(window.foo.bar);
123456789'123456789"123456789#123456
Chrome: 23 index of '.'
Safari: 23 index of '.'
IE : 7 index of 'alert'
FF : 7 index of 'alert'
// e.g. 3
alert(foo.bar);
123456789'123456789"123456789#123456
Chrome: 13 index of 'foo'
Safari: 16 index of '.'
IE : 7 index of 'alert'
FF : 7 index of 'alert'
// e.g. 4
alert(window.atob());
123456789'123456789"123456789#123456
Chrome: 20 index of 'atob'
Safari: 24 index of '()'
IE : 7 index of 'alert'
FF : 7 index of 'alert'
// e.g. 5
(1 + 1, atob());
123456789'123456789"123456789#123456
Chrome: 15 index of 'atob'
Safari: 19 index of '()'
IE : 15 index of 'atob'
FF : 8 index of '1'
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment