Skip to content

Commit

Permalink
Fix get function opcode traces (#2708)
Browse files Browse the repository at this point in the history
 Fix get function opcode traces (`GetFunction`, `GetGenerator`, etc)

```js
function x() {
    let y = 0;
}
```
Before:
```
000000    0000    GetFunction                0000: 'JSInternedStrRef { utf8: Some("x"), utf16: [120] }' (length: 0)
000006    0001    DefInitVar                 0000: 'x'
```

After:
```
000000    0000    GetFunction                0000: 'x' (length: 0)
000006    0001    DefInitVar                 0000: 'x'
```
  • Loading branch information
HalidOdat committed Mar 21, 2023
1 parent f7db12a commit 4544362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion boa_engine/src/vm/code_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ impl CodeBlock {
let operand = self.read::<u32>(*pc);
*pc += size_of::<u32>() + size_of::<u8>();
format!(
"{operand:04}: '{:?}' (length: {})",
"{operand:04}: '{}' (length: {})",
interner.resolve_expect(self.functions[operand as usize].name),
self.functions[operand as usize].length
)
Expand Down

0 comments on commit 4544362

Please sign in to comment.