Skip to content

Commit

Permalink
Switch to mini_racer to support Object.setPrototypeOf in the repl mod…
Browse files Browse the repository at this point in the history
…e. (#1840)
  • Loading branch information
iliabylich committed Jun 5, 2018
1 parent 8cdbc41 commit 796ac3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -19,7 +19,7 @@ gem 'tilt', tilt_version if tilt_version
gem 'sprockets', sprockets_version if sprockets_version

group :repl do
gem 'therubyracer', platform: :mri, require: false
gem 'mini_racer', platform: :mri, require: false
gem 'therubyrhino', platform: :jruby, require: false
end

Expand Down
14 changes: 3 additions & 11 deletions exe/opal-repl
Expand Up @@ -14,20 +14,12 @@ module Opal
return if @v8

begin
require 'v8'
require 'mini_racer'
rescue LoadError
abort 'opal-repl depends on therubyracer gem, which is not currently installed'
abort 'opal-repl depends on mini_racer gem, which is not currently installed'
end

# Patch V8::Object#respond_to? to avoid MRI warning
V8::Object.class_eval do
def respond_to?(method, private = false)
super or self[method] != nil
end
end

@v8 = V8::Context.new
@v8['console'] = self
@v8 = MiniRacer::Context.new
@v8.eval Opal::Builder.new.build('opal').to_s

if filename
Expand Down

0 comments on commit 796ac3f

Please sign in to comment.