Skip to content

Commit

Permalink
Fix to runInContext, runInNewContext and runInThisContext signature
Browse files Browse the repository at this point in the history
According to https://nodejs.org/api/vm.html#scriptrunincontextcontextifiedobject-options, these three functions don't have a second parameter of string type.

These three functions didn't work in my project after build, an exception would be raised, so I fixed this.
  • Loading branch information
Enzojz committed Jan 20, 2024
1 parent 09a2b92 commit 1e35a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/VM.res
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ module Script = {
external makeWithOptions: (string, options) => t = "Script"
@send external createCachedData: t => Buffer.t = "createCachedData"
@send
external runInContext: (t, string, contextifiedObject<'a>) => 'b = "runInContext"
external runInContext: (t, contextifiedObject<'a>) => 'b = "runInContext"
@send
external runInNewContext: (t, string, contextifiedObject<'a>) => 'b = "runInNewContext"
@send external runInThisContext: (t, string) => 'a = "runInThisContext"
external runInNewContext: (t, contextifiedObject<'a>) => 'b = "runInNewContext"
@send external runInThisContext: t => 'a = "runInThisContext"
}

0 comments on commit 1e35a39

Please sign in to comment.