Skip to content

Commit 32e4962

Browse files
committed
console - fix default invocation
1 parent b6abbc1 commit 32e4962

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/pythonmonkey/builtin_modules/console.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class Console {
4242
ignoreErrors = true;
4343
options = { stdout, stderr, ignoreErrors };
4444
}
45-
4645
this.#writeToStdout = options.stdout.write;
4746
this.#writeToStderr = options.stderr.write;
4847
}
@@ -55,7 +54,7 @@ class Console {
5554
}
5655

5756
log(...args) {
58-
this.writeToStdout(this.#formatToStr(...args))
57+
this.#writeToStdout(this.#formatToStr(...args))
5958
}
6059

6160
warn(...args) {
@@ -84,8 +83,8 @@ Console.prototype.error = Console.prototype.warn;
8483

8584
if (!globalThis.console) {
8685
globalThis.console = new Console(
87-
python.stdout.write /* sys.stdout.write */,
88-
python.stderr.write /* sys.stderr.write */
86+
python.stdout /* sys.stdout */,
87+
python.stderr /* sys.stderr */
8988
);
9089
}
9190

tests/js/is-compilable-unit.simple.failing

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ if (isCompilableUnit('()=>'))
1414
if (!isCompilableUnit('123'))
1515
throw new Error('isCompilableUnit lied about 123');
1616

17+
console.log('done')

0 commit comments

Comments
 (0)