|
5 | 5 | */ |
6 | 6 |
|
7 | 7 | var LibraryStackTrace = { |
8 | | - $jsStackTrace: function() { |
9 | | - return new Error().stack.toString(); |
10 | | - }, |
| 8 | + $jsStackTrace: () => new Error().stack.toString(), |
11 | 9 |
|
12 | 10 | $getCallstack__deps: ['$jsStackTrace', '$warnOnce'], |
13 | 11 | $getCallstack__docs: '/** @param {number=} flags */', |
14 | | - $getCallstack: function(flags) { |
| 12 | + $getCallstack: (flags) => { |
15 | 13 | var callstack = jsStackTrace(); |
16 | 14 |
|
17 | 15 | // Find the symbols in the callstack that corresponds to the functions that |
@@ -99,7 +97,7 @@ var LibraryStackTrace = { |
99 | 97 | }, |
100 | 98 |
|
101 | 99 | emscripten_get_callstack__deps: ['$getCallstack', '$lengthBytesUTF8', '$stringToUTF8'], |
102 | | - emscripten_get_callstack: function(flags, str, maxbytes) { |
| 100 | + emscripten_get_callstack: (flags, str, maxbytes) => { |
103 | 101 | var callstack = getCallstack(flags); |
104 | 102 | // User can query the required amount of bytes to hold the callstack. |
105 | 103 | if (!str || maxbytes <= 0) { |
@@ -205,7 +203,7 @@ var LibraryStackTrace = { |
205 | 203 | // must be able to unwind from a PC value that may no longer be on the |
206 | 204 | // execution stack, and so we are forced to cache the entire call stack. |
207 | 205 | emscripten_stack_snapshot__deps: ['$convertFrameToPC', '$UNWIND_CACHE', '$saveInUnwindCache', '$jsStackTrace'], |
208 | | - emscripten_stack_snapshot: function() { |
| 206 | + emscripten_stack_snapshot: () => { |
209 | 207 | var callstack = jsStackTrace().split('\n'); |
210 | 208 | if (callstack[0] == 'Error') { |
211 | 209 | callstack.shift(); |
|
0 commit comments