Add a Readme.md for the CallstackTest app

Add a readme file for the Callstack test app to explain its functionality as well as providing documentation on the expected generated callstacks between the javascript minified byclosure and ajaxmin.
This commit is contained in:
thomabr 2016-12-16 12:25:34 -08:00 коммит произвёл GitHub
Родитель ba28538578
Коммит d53975c2d7
1 изменённых файлов: 22 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,22 @@
# Callstack Test App
This is a test app that hosts a webpage used for generating callstacks on various browsers. The webpage uses the windows.onerror event handler to report the information retrieved on the error object's stack property. If the browser does not return the error object on the windows.onerror event handler, it attempts to report the global window.events.error.stack property. By default the test app loads javascript minified by Ajaxmin (CrashCauser.js) which contains logic to generate a callstack when the "Cause Crash" button is clicked. This javascript is minified automatically as part of the msbuild process. There is also sample javascript checked in that has been minified with Google Closure (closureCrashCauser.js->closureCrashCauser.minified.js). In order to avoid the test app from taking a dependency on java, the process to minify the javascript and generate a sourcemap with closure is manual and if any changes are made to closurecrashcauser.js, the corresponding closurecrashcauser.minified.js and closurecrashcauser.sourcemap would need to be updated manually. This is done by running the locally on your machine and updated the minfied js and sourcemap. To switch the testapp to use the different minfiied versions of the javascript, you need to change the script tag loaded in index.html.
##Javascript Minified using Ajax Min (CrashCauser.min.js)
CrashCauser.js is minified with Ajaxmin. The minfied version of the javascript and the sourcemap are generated at build time and not checked in via gitignore rules (crashcauser.min.js and crashcauser.min.js.map). The deminified stackframe should look similar to the following
```
level3
level3
level2
level1
causeCrash
window
```
## Javascript minified using Google Closure (closureCrashCauser.minified.js)
closurecrashcauser.js is minified with Google Closure. The minified version of the javascript and the sourcemap are generated manually and are part of the source code (closurecrashcauser.minified.js and cclosurecrashcauser.sourcemap). The deminified stackframe should look similar to the following
```
mynamespace.objectWithMethods.propertyMethodLevel2
mynamespace.objectWithMethods.prototypeMethodLevel1
GlobalFunction
window
```