Skip to content

Commit

Permalink
Add example test page
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Jan 18, 2013
1 parent 8fcefd0 commit 77381f9
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 0 deletions.
3 changes: 3 additions & 0 deletions example/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

build:
../node_modules/.bin/uglifyjs --source-map=file.sourcemap.js -c -o file.min.js file1.js file2.js
2 changes: 2 additions & 0 deletions example/file.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/file.sourcemap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions example/file1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function add(a, b) {
"use strict";
return a + b;
}
12 changes: 12 additions & 0 deletions example/file2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function multiply(a, b) {
"use strict";
return a * b;
}
function divide(a, b) {
"use strict";
try {
return multiply(add(a, b), a, b) / c;
} catch (e) {
Raven.captureException(e);
}
}
30 changes: 30 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html>
<head>
<title>Scratch Disk</title>
</head>
<script src="../src/vendor/TraceKit/tracekit.js"></script>
<script src="../src/raven.js"></script>
<!-- <script src="scratch.min.js"></script> -->
<script src="scratch.js" crossorigin></script>
<script src="file.min.js" crossorigin></script>
<script>
//cool
//really cool
//awesome
Raven.config('http://50dbe04cd1224d439e9c49bf1d0464df@localhost:8000/1').install();

Raven.setUser({
email: 'matt@ydekproductions.com',
id: 5
})


</script>
<body>
<button id="test">Break me</button>
<script>ready()</script>

<button onclick="divide(1, 0)">Sourcemap breakage</button>
</body>
</html>
28 changes: 28 additions & 0 deletions example/scratch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
function foo() {
console.log("lol, i don't do anything")
}

function foo2() {
foo()
console.log('i called foo')
}

function broken() {
try {
/*fkjdsahfdhskfhdsahfudshafuoidashfudsa*/ fdasfds[0]; // i throw an error h sadhf hadsfdsakf kl;dsjaklf jdklsajfk ljds;klafldsl fkhdas;hf hdsaf hdsalfhjldksahfljkdsahfjkl dhsajkfl hdklsahflkjdsahkfj hdsjakhf dkashfl diusafh kdsjahfkldsahf jkdashfj khdasjkfhdjksahflkjdhsakfhjdksahfjkdhsakf hdajskhf kjdash kjfads fjkadsh jkfdsa jkfdas jkfdjkas hfjkdsajlk fdsajk fjkdsa fjdsa fdkjlsa fjkdaslk hfjlkdsah fhdsahfui
}catch(e) {
Raven.captureException(e);
}
}

function ready() {
document.getElementById('test').onclick = broken;
}

function foo3() {
document.getElementById('crap').value = 'barfdasjkfhoadshflkaosfjadiosfhdaskjfasfadsfads';
}

function somethingelse() {
document.getElementById('somethingelse').value = 'this is some realy really long message just so our minification is largeeeeeeeeee!';
}

0 comments on commit 77381f9

Please sign in to comment.