Skip to content

Commit

Permalink
Expose console.warn, console.info, console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
medicz committed Sep 21, 2023
1 parent f0323ce commit 2ffd153
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ return (
);
```

- Expose `console.info`, `console.warn` and `console.error` logging

## 2.4.2

- Add missing code changes (`cacheOptions` and `lodash`) from 2.4.0.
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/lib/vm/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,8 @@ class VmStack {
},
args[0]
);
} else if (keyword === "console" && callee === "log") {
return console.log(this.vm.widgetSrc, ...args);
} else if (keyword === "console" && ["error", "info", "log", "warn"].includes(callee)) {
return console[callee](this.vm.widgetSrc, ...args);
} else if (keyword === "clipboard" && callee === "writeText") {
return this.isTrusted
? navigator.clipboard.writeText(...args)
Expand Down

0 comments on commit 2ffd153

Please sign in to comment.