These are chat archives for opal/opal

31st
Jan 2017
Adam Jahn
@ajjahn
Jan 31 2017 21:21

Would anyone be so kind as to provide some info on why the Native module's Hash initializer requires the native object to have a constructor of Object? Source: https://github.com/opal/opal/blob/12ce992e6fe08ddb862bafa5a04c8be9ced2616d/stdlib/native.rb#L529

I'm currently wrapping a library that has tons of objects created via Object.create(null), which means even though they essentially are behaving as an options hash, I can't simply wrap them in Hash.new('opts').

As a work around, I'm simply setting opts.constructor = Object before Hash.new('opts'), but I don't like it.