@steve02081504/virtual-console 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/browser.mjs +5 -5
  2. package/package.json +1 -1
package/browser.mjs CHANGED
@@ -138,12 +138,12 @@ export class VirtualConsole {
138
138
  if (this.options.recordOutput) {
139
139
  this.outputs += formatArgs(args) + '\n'
140
140
  this.outputsHtml += argsToHtml(args) + '<br/>\n'
141
- }
142
141
 
143
- if (method == 'trace') {
144
- const stack = new Error().stack
145
- this.outputs += stack.slice(stack.indexOf('\n') + 1) + '\n'
146
- this.outputsHtml += escapeHtml(stack.slice(stack.indexOf('\n') + 1)) + '<br/>\n'
142
+ if (method == 'trace') {
143
+ const stack = new Error().stack || '\nNot available'
144
+ this.outputs += stack.slice(stack.indexOf('\n') + 1) + '\n'
145
+ this.outputsHtml += escapeHtml(stack.slice(stack.indexOf('\n') + 1)) + '<br/>\n'
146
+ }
147
147
  }
148
148
 
149
149
  // 实际输出
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steve02081504/virtual-console",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "A virtual console for capturing and manipulating terminal output.",
5
5
  "main": "main.mjs",
6
6
  "type": "module",