Opal v0.9.0 Release Notes

Release Date: 2015-12-20 // over 8 years ago
  • โž• Added

    • A console wrapper has been added to the stdlib, requiring it will make available the $console global variable.
    • โž• method_added, method_removed and method_undefined reflection now works.
    • singleton_method_added, singleton_method_removed and singleton_method_undefined reflection now works.
    • ๐Ÿ’Ž Now you can bridge a native class to a Ruby class that inherits from another Ruby class
    • ๐Ÿ’Ž Numeric semantics are now compliant with Ruby.
    • Complex has been fully implemented.
    • Rational has been fully implemented.
    • ๐Ÿ‘ป Kernel#raise now properly re-raises exceptions (regardless of how many levels deep you are) and works properly if supplied a class that has an exception method.
    • ๐Ÿ‘ป Exception#exception, Exception::exception, Exception#message, and Exception#to_s are fully implemented
    • ๐Ÿ‘ You can make direct JavaScript method calls on using the recv.JS.methodsyntax. Has support for method calls, final callback (as a block), property getter and setter (via #[] and #[]=), splats, JavaScript keywords (via the ::JS module) and global functions (after require "js").
    • Set#superset?, Set#subset?, and the respective proper_ variant of each are now implemented
    • NameError and NoMethodError - add #name and #args attributes
    • RegExp#match now works correctly in multiline mode with white space
    • ๐Ÿ“œ BasicObject#instance_eval now can accept a string argument (after require "opal-parser")
    • โž• Adds Nashorn (Java 8+ Javascript engine) runner bundle exec bin/opal -R nashorn -r nashorn hello.rb

    • ๐Ÿ†• Newly compliant with the Ruby Spec Suite:

      • Enumerable#chunk
      • Enumerable#each_cons
      • Enumerable#minmax
      • Range#to_a (#1246)
      • Module comparison methods: #< #<= #<=> #> #>=
      • OpenStruct#method_missing
      • OpenStruct#inspect
      • OpenStruct#to_s
      • OpenStruct#delete_field

    ๐Ÿ”„ Changed

    • ๐Ÿ“‡ Renamed:
      • Hash.keys => Hash.$$keys
      • Hash.map => Hash.$$map
      • Hash.smap => Hash.$$smap
    • ๐Ÿ‘€ Kernel#pp no longer forwards arguments directly to console.log, this behavior has been replaced by stdlib's own console.rb (see above).
    • Opal::Sprockets.javascript_include_tag has been added to allow easy debug mode (i.e. with source maps) when including a sprockets asset into an HTML page.

    ๐Ÿ—„ Deprecated

    • Opal::Processor.load_asset_code(sprockets, name) has been deprecated in favor of Opal::Sprockets.load_asset(name, sprockets).

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed usage of JavaScript keywords as instance variable names for:
      • Kernel#instance_variable_set
      • Kernel#instance_variable_get
      • Kernel#instance_variables
    • Struct#hash now works properly based on struct contents
    • No longer crashes when calling a method with an opt arg followed by an optional kwarg when called without the kwarg
    • Operator methods (e.g. +, <, etc.) can be handled by method_missing
    • ๐Ÿ›  Fix issue where passing a block after a parameter and a hash was causing block to not be passed (e.g. method1 some_param, 'a' => 1, &block)
    • Method defs issued inside Module#instance_eval and Class#instance_eval, and the respective exec now create class methods
    • ๐Ÿ‘ Now with enabled arity checks calling a method with more arguments than those supported by its signature raises an ArgumentError as well.
    • Previously arity checks would raise an error without clearing the block for a method, that could lead to strange bugs in case the error was rescued.
    • Regexp#=== returns false when the right hand side of the expression cannot be coereced to a string (instead of throwing a TypeError)
    • โšก๏ธ Regexp#options has been optimized and correctly returns 0 when called on a Regexp literal without any options (e.g. //)
    • ๐Ÿ›  Fix Kernel#exit to allow exit inside #at_exit
    • ๐Ÿ›  Fixed a number of syntax errors (e.g. #1224 #1225 #1227 #1231 #1233 #1226)
    • ๐Ÿ›  Fixed Native() when used with Array instances containing native objects (which weren't wrapped properly) โ€“ #1212
    • Fix Array#to_n, Hash#to_n, Struct#to_n when the object contains native objects (#1249)
    • Internal cleanup and lots of bugs!