Index: src/js/messages.js |
diff --git a/src/js/messages.js b/src/js/messages.js |
index 439043f809c5b50151c3313ed8e6b88e9e484d11..24d8d2bfa188bf3544e03083597e1dd7edd8ea2d 100644 |
--- a/src/js/messages.js |
+++ b/src/js/messages.js |
@@ -530,13 +530,15 @@ function FormatErrorString(error) { |
function GetStackFrames(raw_stack) { |
+ var internal_raw_stack = new InternalArray(); |
+ %MoveArrayContents(raw_stack, internal_raw_stack); |
var frames = new InternalArray(); |
- var sloppy_frames = raw_stack[0]; |
- for (var i = 1; i < raw_stack.length; i += 4) { |
- var recv = raw_stack[i]; |
- var fun = raw_stack[i + 1]; |
- var code = raw_stack[i + 2]; |
- var pc = raw_stack[i + 3]; |
+ var sloppy_frames = internal_raw_stack[0]; |
+ for (var i = 1; i < internal_raw_stack.length; i += 4) { |
+ var recv = internal_raw_stack[i]; |
+ var fun = internal_raw_stack[i + 1]; |
+ var code = internal_raw_stack[i + 2]; |
+ var pc = internal_raw_stack[i + 3]; |
// For traps in wasm, the bytecode offset is passed as (-1 - offset). |
// Otherwise, lookup the position from the pc. |
var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) : |