Skip to content

Instantly share code, notes, and snippets.

@patrickkettner
Last active January 23, 2017 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickkettner/1c102194d978d6c2a940ce49f4b3d883 to your computer and use it in GitHub Desktop.
Save patrickkettner/1c102194d978d6c2a940ce49f4b3d883 to your computer and use it in GitHub Desktop.
opal bug #1581

steps to repro

  • git clone https://gist.github.com/patrickkettner/1c102194d978d6c2a940ce49f4b3d883 && cd 1c102194d978d6c2a940ce49f4b3d883
  • bundle install
  • bundle exec opal --gem temple --stub tilt --stub temple/utils --compile ./main.rb > ./out.js
  • compare output with irb/pry
  • note that none of the APIs that exist on Temple::Generators::Array exist on Opal.Temple.$$scope.Generators.$$scope.Array
  • note that changing the Temple Array class to any other value (e.g. class Temple_Array) makes the same code function
source 'https://rubygems.org'
gem "temple", "0.6.5"
gem "opal"
<!doctype html>
<head>
<meta charset="UTF-8">
<title>opal bug</title>
<script src="./out.js"></script>
</head>
<body></body>
require 'temple'
puts Temple::Generators::Array.superclass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment