Opal v0.7.0 Release Notes
Release Date: 2015-02-01 // over 9 years ago-
Stop keyword-arg variable names leaking to global javascript scope
💎
Class#native_class
now also exposesMyClass.new
(Ruby) asOpal.global.MyClass.new()
(JS)➕ Add CRuby (MRI) tests harness to start checking Opal against them too.
➕ Add Minitest to the stdlib.
➕ Add
Date#<=>
with specs.🏗 Show extended info and context upon parsing, compiling and building errors.
👌 Support keyword arguments in method calls and definitions.
🛠 Fix
begin
/rescue
blocks to evaluate to last expression.💎 Add support for
RUBY_ENGINE/RUBY_PLATFORM != "opal"
pre-processor directives.if RUBY_ENGINE != "opal" # this code never compiles end
🛠 Fix donating methods defined in modules. This ensures that if a class includes more than one module, then the methods defined on the class respect the order in which the modules are included.
👌 Improved support for recursive
Hash
for both#inspect
and#hash
.⚡️ Optimized
Hash
implementation forString
andSymbol
, they have a separate hash-table in which they're used as both keys and hashes.➕ Added real
#hash
/eql?
support, previously was relying on.toString()
.String#to_proc
now uses__send__
instead ofsend
for calling methods on receivers.🗄 Deprecated
Opal::Sprockets::Environment
. It can easily be replaced byOpal::Server
or by appendingOpal.paths
to aSprockets::Environment
:Sprockets::Environment.new.tap { |e| Opal.paths.each {|p| e.append_path(p)} }
➕ Add
Set
methods#classify
,#collect!
,#map!
,#subtract
#replace
,#difference
and#eql?
👌 Support
module_function
without args to toggle module functions.🛠 Fix bug where command calls with no space and sym arg were incorrectly parsed.
➕ Add some
StringScanner
methods.➕ Add
Date#<<
andDate#>>
implementations.👌 Support nested directories using
require_tree
directive.🛠 Fix bug where Exception subclasses could not have methods defined on them.
🛠 Fix symbols with interpolations
:"#{foo}"
👍 Implement $1..N matchers and rewrite support for $~, $', $& and $`.
Implement
Regexp.last_match
.🛠 Fixed
-@
unary op. precedence with a numeric and followed by a method call (e.g.-1.foo
was parsed as-(1.foo)
)require_relative
(with strings) is now preprocessed, expanded and added toCompiler#requires
Rewritten the require system to respect requires position (previously all the requires were stacked up at the top of the file)
Implement for-loop syntax
➕ Add Array#|
🛠 Fix Range.new to raise
ArgumentError
on contructor values that cannot be compared🛠 Fix compiler bug where Contiguous strings were not getting concatenated.
Cleanup generated code for constant access. All constant lookups now go through
$scope.get('CONST_NAME')
to produce cleaner code and a unified place for const missing dispatch.✂ Remove
const_missing
option from compiler. All constant lookups are now strict.➕ Add initial support for Module#autoload.
🛠 Fix
Enumerator#with_index
,Numeric#round
.