The unit tests for this library leverage the functionality provided by Rhino Mocks. The call stack deminifier and test app both use Ajax Min which is licensed under the Apache License, Version 2.0. The source map parser uses Json.NET which is licensed under the MIT License. The source map parsing implementation and the relevant comments were based on the Source Maps V3 spec which is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. The Base64 VLQ decoding code was based on the implmentation in the Closure Compiler which is licensed under the Apache License, Version 2.0. In order to minimize confusion, line and column numbers are normalized to be zero based throughout the library. Remarksīrowsers return one based line and column numbers, while the source map spec calls for zero based line and column numbers. Since the StackTraceDeminifier returned from this method only reads the source map once, the deminified stack frames will only contain the deminified method name and will not contain the original source location. In order to allow for the StackTraceDeminifier to be used on servers with limited memory resources, the StackTraceDeminfierFactory exposes a GetMethodNameOnlyStackTraceDeminfier method that returns a StackTraceDeminifier that does not keep source maps in memory. Parsed soure maps can take up a lot of memory for large JavaScript files. Note that any of the properties on a StackTrace object may be null if no value could be extracted from the input callstack string or source map. The DeminifiedStackFrame property contains the best guess StackFrame object that maps to the MinifiedStackFrame element with the same index. The result of DeminifyStackTrace is a DeminifyStackTraceResult, which is an object that contains a list of StackFrameDeminificationResults which contains the parsed minified StackFrame objects in the MinifiedStackFrame property and an enum indicating if any errors occured when attempting to deminify the StackFrame. DeminifyStackTrace (callstack ) string deminifiedCallstack = deminifyStackTraceResult. GetStackTraceDeminfier ( new SourceMapProvider ( ), new SourceCodeProvider ( ) ) DeminifyStackTraceResult deminifyStackTraceResult = sourceMapCallstackDeminifier. StackTraceDeminifier sourceMapCallstackDeminifier = StackTraceDeminifierFactory. ![]() ![]() The allows for the deminification of JavaScript call stacks. ApplySourceMap (bundledToOriginal ) Call Stack Deminification will contain mapping for line 3, column 2 in the minified file to line 34, column 23 in the original file SourceMap minifiedToOriginal = minifiedToBundled.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |