Skip to content

Commit

Permalink
Remove js.Bundle.IsExecutable() because it's not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Mar 16, 2022
1 parent 3b3e386 commit 85c5169
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
7 changes: 0 additions & 7 deletions js/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,6 @@ func (b *Bundle) Instantiate(
return bi, instErr
}

// IsExecutable returns whether the given name is an exported and
// executable function in the script.
func (b *Bundle) IsExecutable(name string) bool {
_, exists := b.exports[name]
return exists
}

// Instantiates the bundle into an existing runtime. Not public because it also messes with a bunch
// of other things, will potentially thrash data and makes a mess in it if the operation fails.
func (b *Bundle) instantiate(logger logrus.FieldLogger, rt *goja.Runtime, init *InitContext, vuID uint64) error {
Expand Down
5 changes: 2 additions & 3 deletions js/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,9 @@ func (r *Runner) GetOptions() lib.Options {

// IsExecutable returns whether the given name is an exported and
// executable function in the script.
//
// TODO: completely remove this?
func (r *Runner) IsExecutable(name string) bool {
return r.Bundle.IsExecutable(name)
_, exists := r.Bundle.exports[name]
return exists
}

// HandleSummary calls the specified summary callback, if supplied.
Expand Down

0 comments on commit 85c5169

Please sign in to comment.