0

I'm trying to run axlsign.js from ruby using mini_racer gem.

context = MiniRacer::Context.new
context.load('axlsign.js')
context.eval('axlsign.generateKeyPair(new Uint8Array(32))')

It returns error JavaScript at <anonymous>:1436:4: ReferenceError: self is not defined (MiniRacer::RuntimeError)

Browser javascript console executes axlsign.generateKeyPair(new Uint8Array(32)) without any problems.

Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47

1 Answers1

0

I've changed self to this on the very last line of the JS file and it resolved the issue.

Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47