(relaxed?: boolean, rounded?: boolean)
| 203 | } |
| 204 | |
| 205 | getTrace(relaxed?: boolean, rounded?: boolean) { |
| 206 | let traceArr = this.traceArr, |
| 207 | len = traceArr.length, |
| 208 | str = '', |
| 209 | n, |
| 210 | trace, |
| 211 | method, |
| 212 | args; |
| 213 | |
| 214 | for (n = 0; n < len; n++) { |
| 215 | trace = traceArr[n]; |
| 216 | method = trace.method; |
| 217 | |
| 218 | // methods |
| 219 | if (method) { |
| 220 | args = trace.args; |
| 221 | str += method; |
| 222 | if (relaxed) { |
| 223 | str += DOUBLE_PAREN; |
| 224 | } else { |
| 225 | if (Util._isArray(args[0])) { |
| 226 | str += OPEN_PAREN_BRACKET + args.join(COMMA) + CLOSE_BRACKET_PAREN; |
| 227 | } else { |
| 228 | if (rounded) { |
| 229 | args = args.map((a) => |
| 230 | typeof a === 'number' ? Math.floor(a) : a |
| 231 | ); |
| 232 | } |
| 233 | str += OPEN_PAREN + args.join(COMMA) + CLOSE_PAREN; |
| 234 | } |
| 235 | } |
| 236 | } else { |
| 237 | // properties |
| 238 | str += trace.property; |
| 239 | if (!relaxed) { |
| 240 | str += EQUALS + trace.val; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | str += SEMICOLON; |
| 245 | } |
| 246 | |
| 247 | return str; |
| 248 | } |
| 249 | |
| 250 | clearTrace() { |
| 251 | this.traceArr = []; |
no outgoing calls
no test coverage detected