Skip to content

Commit b395ee9

Browse files
author
Eric Wendelin
committed
Direct users of stable version to the stable branch.
1 parent cb0300b commit b395ee9

File tree

1 file changed

+5
-69
lines changed

1 file changed

+5
-69
lines changed

README.md

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,20 @@
11
# Welcome to stacktrace.js! [![Code Climate](https://codeclimate.com/github/stacktracejs/stacktrace.js.png)](https://codeclimate.com/github/stacktracejs/stacktrace.js)
22
A JavaScript tool that allows you to debug your JavaScript by giving you a [stack trace](http://en.wikipedia.org/wiki/Stack_trace) of function calls leading to an error (or any condition you specify)
33

4-
# Usage
5-
Just include stacktrace.js file on your page, and call it like so:
4+
## Usage
5+
stacktrace.js is getting a new API!
66

7-
```html
8-
<script type="text/javascript" src="https://rawgithub.com/stacktracejs/stacktrace.js/master/stacktrace.js"></script>
9-
<script type="text/javascript">
10-
// your code...
11-
var trace = printStackTrace();
12-
alert(trace.join('\n\n')); // Output however you want!
13-
// more code of yours...
14-
</script>
15-
```
16-
17-
You can also pass in your own Error to get a stacktrace *not available in IE or Safari 5-*
7+
Looking for the [stable version](https://github.com/stacktracejs/stacktrace.js/tree/stable)?
188

19-
```html
20-
<script type="text/javascript" src="https://rawgithub.com/stacktracejs/stacktrace.js/master/stacktrace.js"></script>
21-
<script type="text/javascript">
22-
try {
23-
// error producing code
24-
} catch(e) {
25-
var trace = printStackTrace({e: e});
26-
alert('Error!\n' + 'Message: ' + e.message + '\nStack trace:\n' + trace.join('\n'));
27-
// do something else with error
28-
}
29-
</script>
30-
```
31-
32-
Note that error message is not included in stack trace.
33-
34-
Bookmarklet available on the [project home page](http://stacktracejs.com).
35-
36-
# Function Instrumentation #
37-
You can now have any (public or privileged) function give you a stacktrace when it is called:
38-
39-
```javascript
40-
function logStackTrace(stack) {
41-
console.log(stack.join('\n'));
42-
}
43-
var p = new printStackTrace.implementation();
44-
p.instrumentFunction(this, 'baz', logStackTrace);
45-
46-
function foo() {
47-
var a = 1;
48-
bar();
49-
}
50-
function bar() {
51-
baz();
52-
}
53-
foo(); //Will log a stacktrace when 'baz()' is called containing 'foo()'!
54-
55-
p.deinstrumentFunction(this, 'baz'); //Remove function instrumentation
56-
```
57-
58-
# Get stacktrace.js
9+
## Get stacktrace.js
5910
```
6011
npm install stacktrace-js
6112
bower install stacktrace-js
6213
component install stacktrace.js
6314
wget https://rawgithub.com/stacktracejs/stacktrace.js/master/stacktrace.js
6415
```
6516

66-
# Browser Support
67-
It is currently tested and working on:
68-
69-
- Firefox (and Iceweasel) 0.9+
70-
- Google Chrome 1+
71-
- Safari 3.0+ (including iOS 1+)
72-
- Opera 7+
73-
- IE 5.5+
74-
- Konqueror 3.5+
75-
- Flock 1.0+
76-
- SeaMonkey 1.0+
77-
- K-Meleon 1.5.3+
78-
- Epiphany 2.28.0+
79-
- Iceape 1.1+
80-
81-
## Contributions [![Stories in Ready](http://badge.waffle.io/stacktracejs/stacktrace.js.png)](http://waffle.io/stacktracejs/stacktrace.js)
17+
## Contributions
8218

8319
This project is made possible due to the efforts of these fine people:
8420

0 commit comments

Comments
 (0)