Commit 2e8babeb authored by yann300's avatar yann300

if error should also return the type name

parent 8ea4e5d8
......@@ -20,7 +20,10 @@ class RefType {
*/
decodeFromStack (stackDepth, stack, memory, storage) {
if (stack.length - 1 < stackDepth) {
return { error: '<decoding failed - stack underflow ' + stackDepth + '>' }
return {
error: '<decoding failed - stack underflow ' + stackDepth + '>',
type: this.typeName
}
}
if (!storage) {
storage = {} // TODO this is a fallback, should manage properly locals store in storage
......@@ -32,7 +35,10 @@ class RefType {
} else if (this.isInMemory()) {
return this.decodeFromMemoryInternal(offset, memory)
} else {
return { error: '<decoding failed - no decoder for ' + this.location + '>' }
return {
error: '<decoding failed - no decoder for ' + this.location + '>',
type: this.typeName
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment