Skip to content

Commit

Permalink
Remove one unneeded usage of common.BindToGlobal
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Feb 4, 2022
1 parent 56ff376 commit 56b3486
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,10 @@ func (r *Runner) newVU(idLocal, idGlobal uint64, samplesOut chan<- stats.SampleC

// This is here mostly so if someone tries they get a nice message
// instead of "Value is not an object: undefined ..."
common.BindToGlobal(vu.Runtime, map[string]interface{}{
"open": func() {
vu.Runtime.GlobalObject().Set("open",
func() {
common.Throw(vu.Runtime, errors.New(openCantBeUsedOutsideInitContextMsg))
},
})
})

return vu, nil
}
Expand Down

0 comments on commit 56b3486

Please sign in to comment.