mirror of
https://github.com/rubyjs/mini_racer
synced 2023-03-27 23:21:28 -04:00
DOC: write_heap_snapshot (#164)
This commit is contained in:
parent
4f40f41ce4
commit
23e0369720
1 changed files with 10 additions and 0 deletions
10
README.md
10
README.md
|
@ -315,6 +315,16 @@ context.eval("a = 2")
|
|||
# nothing works on the context from now on, its a shell waiting to be disposed
|
||||
```
|
||||
|
||||
A MiniRacer context can also be dumped in a heapsnapshot file using `#write_heap_snapshot(file_or_io)`
|
||||
|
||||
```ruby
|
||||
context = MiniRacer::Context.new(timeout: 5)
|
||||
context.eval("let a='testing';")
|
||||
context.write_heap_snapshot("test.heapsnapshot")
|
||||
```
|
||||
|
||||
This file can then be loaded in the memory tab of the chrome dev console.
|
||||
|
||||
### Function call
|
||||
|
||||
This calls the function passed as first argument:
|
||||
|
|
Loading…
Reference in a new issue