1
0
Fork 0
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:
Joffrey JAFFEUX 2020-05-18 07:16:11 +02:00 committed by GitHub
parent 4f40f41ce4
commit 23e0369720
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: