Skip to content

Commit 6759e95

Browse files
authored
Remove dead code in runtime_debug.js. NFC (#17012)
I was running with PTHREADS_DEBUG + closure and closure figured out that all this code is dead. I traced this all the way back to 2012 when it first became dead code: 9b2446d
1 parent 1314e69 commit 6759e95

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

src/runtime_debug.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,7 @@ function prettyPrint(arg) {
6363
return arg + '\n\n';
6464
}
6565
if (arg.byteLength) {
66-
return '{' + Array.prototype.slice.call(arg, 0, Math.min(arg.length, 400)) + '}'; // Useful for correct arrays, less so for compiled arrays, see the code below for that
67-
var buf = new ArrayBuffer(32);
68-
var i8buf = new Int8Array(buf);
69-
var i16buf = new Int16Array(buf);
70-
var f32buf = new Float32Array(buf);
71-
switch (arg.toString()) {
72-
case '[object Uint8Array]':
73-
i8buf.set(arg.subarray(0, 32));
74-
break;
75-
case '[object Float32Array]':
76-
f32buf.set(arg.subarray(0, 5));
77-
break;
78-
case '[object Uint16Array]':
79-
i16buf.set(arg.subarray(0, 16));
80-
break;
81-
default:
82-
alert('unknown array for debugging: ' + arg);
83-
throw 'see alert';
84-
}
85-
var ret = '{' + arg.byteLength + ':\n';
86-
var arr = Array.prototype.slice.call(i8buf);
87-
ret += 'i8:' + arr.toString().replace(/,/g, ',') + '\n';
88-
arr = Array.prototype.slice.call(f32buf, 0, 8);
89-
ret += 'f32:' + arr.toString().replace(/,/g, ',') + '}';
90-
return ret;
66+
return '{' + Array.prototype.slice.call(arg, 0, Math.min(arg.length, 400)) + '}';
9167
}
9268
if (typeof arg == 'function') {
9369
return '<function>';

0 commit comments

Comments
 (0)