Opal v0.4.0 Release Notes

Release Date: 2013-06-15 // almost 11 years ago
    • ➕ Added fragments to parser. All parser methods now generate one or more Fragments which store the original sexp. This allows us to enumerate over them after parsing to map generated lines back to original line numbers.

    • ⏪ Reverted null for nil. Too buggy at this time.

    • ➕ Add Opal::SprocketsParser as Parser subclass for handling parsing for sprockets environment. This subclass handles require statements and stores them for sprockets to use.

    • ➕ Add :irb option to parser to keep top level lvars stored inside opal runtime so that an irb session can be persisted and maintain access to local variables.

    • ➕ Add Opal::Environment#use_gem() helper to add a gem to opals load path.

    • Stop pre-setting ivars to nil. This is no longer needed as nil is now null or undefined.

    • 👉 Use null as nil in opal. This allows us to send methods to null and undefined, and both act as nil. This makes opal a much better javascript citizen. REVERTED

    • ➕ Add Enumerable#none? with specs.

    • ➕ Add Opal.block_send() runtime helper for sending methods to an object which uses a block.

    • ✂ Remove _klass variable for denoting ruby classes, and use constructor instead. constructor is a javascript property used for the same purpose, and this makes opal fit in as a better js citizen.

    • ➕ Add Class.bridge_class method to bridge a native constructor into an opal class which will set it up with all methods from Object, as well as giving it a scope and name.

    • ➕ Added native #[]= and #to_h methods, for setting properties and converting to a hash respectivaly.

    • 🛠 Fix bug where '::' was parsed as :colon2 instead of :colon3 when in an args scope. Fixes #213

    • ✂ Remove lots of properties added to opal classes. This makes normal js constructors a lot closer to opal classes, making is easier to treat js classes as opal classes.

    • 🔀 Merge Hash.from_native into Hash.new