Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.
This repository was archived by the owner on May 3, 2026. It is now read-only.

this is weird when you use #call #39

Description

@judofyr
require 'rhino'
p Rhino::VERSION  # => 2.0.4

ctx = Rhino::Context.new
ctx.eval('this.bar = 123');
p ctx.eval('(function() { return this.bar })()')     # => 123 (as expected)
p ctx.eval('this.bar')                               # => 123 (as expected)
p ctx.eval('(function() { return this.bar })').call  # => nil ???

Seems like there a different this when you invoke a function through #call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions