You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a recursive array is created (an array that contains itself) and then passed to console.log, a stack overflow occurs.
To Reproduce
constarr=[];arr.push(arr);console.log(arr);
Expected behavior
Normally, something like [Array(1)] is displayed.
This works correctly in both the REPL and WASM demo if console.log is not used. In the WASM demo, this error occurs if console.log is used: RuntimeError: memory access out of bounds. In the REPL/CLI, this error occurs if console.log is used: thread 'main' has overflowed its stack
The console.log spec can be found here.
Build environment (please complete the following information):
Describe the bug
If a recursive array is created (an array that contains itself) and then passed to
console.log
, a stack overflow occurs.To Reproduce
Expected behavior
Normally, something like
[Array(1)]
is displayed.This works correctly in both the REPL and WASM demo if
console.log
is not used. In the WASM demo, this error occurs ifconsole.log
is used:RuntimeError: memory access out of bounds
. In the REPL/CLI, this error occurs ifconsole.log
is used:thread 'main' has overflowed its stack
The
console.log
spec can be found here.Build environment (please complete the following information):
Windows 10
Version 1909 (OS Build 18363.1082)
x86_64-pc-windows-msvc
rustc 1.46.0 (04488afe3 2020-08-24)
Additional context
Spec: https://console.spec.whatwg.org/#logger
MDN: https://developer.mozilla.org/en-US/docs/Web/API/Console/log
Related issue: #545
Related PR: #777
The text was updated successfully, but these errors were encountered: