File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -1253,12 +1253,11 @@ module OutputPanel = {
1253
1253
if type_ === "log" {
1254
1254
let args : array <string > = data ["args" ]
1255
1255
1256
- // Js.log(("args", arg))
1257
1256
setLogs (
1258
1257
previousLogs =>
1259
1258
previousLogs
1260
1259
-> Belt .Option .getWithDefault ([])
1261
- -> Js .Array2 .concat (args )
1260
+ -> Js .Array2 .concat ([ args ] )
1262
1261
-> Some ,
1263
1262
)
1264
1263
}
@@ -1340,8 +1339,8 @@ module OutputPanel = {
1340
1339
-> Js .Array2 .map (log =>
1341
1340
<pre >
1342
1341
{log
1343
- -> Js .String2 . make
1344
- -> React .string }
1342
+ -> Js .Array2 . map ( item => < span > { ` ${item} ` -> React . string } </ span >)
1343
+ -> React .array }
1345
1344
</pre >
1346
1345
)
1347
1346
-> React .array
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ module Frame = {
23
23
<head>
24
24
<meta charset="UTF-8" />
25
25
<title>Playground Output</title>
26
+ <style>
27
+ * {
28
+ color: rgb(205, 205, 214);
29
+ }
30
+ </style>
26
31
</head>
27
32
<body>
28
33
<div id="root"></div>
@@ -43,15 +48,14 @@ module Frame = {
43
48
try {
44
49
eval(event.data);
45
50
} catch (err) {
46
- console.log (err);
51
+ console.error (err);
47
52
}
48
53
});
49
54
console.log = (...args) => {
50
55
let finalArgs = args.map(arg => {
51
- if (typeof arg == 'object') {
56
+ if (typeof arg === 'object') {
52
57
return JSON.stringify(arg);
53
58
}
54
-
55
59
return arg;
56
60
});
57
61
parent.window.postMessage({ type: 'log', args: finalArgs }, '*')
You can’t perform that action at this time.
0 commit comments