Bot releases are hidden (Show)
IO#gets
getting an extra char under some circumstances (#2349)TypeError
instead of UndefinedMethod
if not a string is passed to __send__
(#2346)$~
when calling String#scan
from internal methods (#2353)Module#const_get
(#2354)Proc#binding
to return a binding if Binding
is defined (#2341, #2340)Array#zip
to correctly yield
(#2342, #1611)String#scan
to correctly yield
(#2342, #1660)retry
(#2264)#cause
, #backtrace_locations
, #full_message
to Exception
Thread::Backtrace::Location
:class
support (#2049)JS[]
to access properties on the global object (#2259)ENV.fetch
to the Nodejs implementation of ENV
(#2259)eval()
(#2256)Kernel#binding
(#2256)--esm
CLI option (#2286)Regexp#names
and add named captures support (#2272)ls
to show available constants and variableMethod#===
as an alias to Method#call
, works the same as Proc#===
(#2305)IO#gets
and IO#read_proc
along with other supporting methods (#2309)
#gets
on most platforms, including browsers (via prompt
)--repl
CLI option of the main executable#each_line
throughout the entire IO chainminiracer
)IO#read_proc
or overwrite IO#sysread
# await: true
# await: *_await, sleep
will make any method ending in _await
or named sleep
to be awaited)Kernel#__await__
as a bridge to the await
keyword (inspired by CoffeeScript await support)opal/await
to get additional supportPromiseV1
as an alias to the original (legacy) Promise class#to_v1
and #to_v2
to both classesPromise#to_n
will convert it to a native Promise (v2)Opal::Config.esm
to enable/disable ES modules (#2316)
IO#fileno
, Method#curry
, Buffer#to_s
, Pathname.pwd
(#2332)ARGF
, ENV.{inspect,to_h,to_hash,merge}
, File.{delete,unlink}
, Kernel#system
, Kernel#`, Process::Status
(#2332)__dir__
support (#2323)opal-zeitwerk
and isomorfeus
require
(e.g. like rubygems does)require_tree "./foo", autoload: true
Regexp
literal to not generate invalid syntax as JavaScript (#1616)Kernel#{throw,catch}
along with UncaughtThrowError
(#2264)Kernel#inspect
(#2285)0.digits
was returning an empty array in strict mode (#2301)#digits
(#2301)dstrs
) correctly (#2308)debugger
statement, just return nil
(#2307)-
while stringifying -0.0
(#2304)Regexp#last_match
when $~
is nil (#2328)--
argument in ARGV
(#2332)Object#require
not pointing to Kernel#require
(#2323)Struct.new
(#2259)super
related helpers,find_super_dispatcher
is now find_super
, find_iter_super_dispatcher
is now find_block_super
(#2090)opal-repl
CLI now requires files to be passed with --require
(or -r
) instead of the bare filename (#2309)Process
is now a Module, not a Class - just like in MRI (#2332)s = StringIO.new("a"); s << "b"; s.string
now returns "b", like MRI, but Opal used to return "ab" (#2309)def a(...) puts(...) end
(#2153)(1..)
, (..1)
(#2150)**nil
argument - see #2240 to note limitations (#2152)Random::Formatters
which add methods #{hex,base64,urlsafe_base64,uuid,random_float,random_number,alphanumeric}
to Random
and SecureRandom
(#2218)"\x80"
syntax in String literals (#2235)String#+@
, String#-@
(#2235)begin <CODE> end while <CONDITION>
(#2255)Hash#except!
(#2243){Array,Hash,Struct}#{deconstruct,deconstruct_keys} methods were added)
(#2243)promise/v2
(#2220)Number#to_i
with huge number (#2191)String#start_with
(#2198)String#bytes
now works in strict mode (#2194)Array#unshift
on v8 > 7.1 (#2116)#initialize
with multiple arguments correctly (with a limitation caused by the String immutability issue, that a source string must be the first argument and #initialize
can't change its value) (#2238, #2185)String#unpack("U*")
on binary strings with latin1 high characters, fix performance regression on that call (#2235, #2189, #2129, #2099, #2094, #2000, #2128)String#to_json
output on some edge cases (#2235)String#b
no longer modifies object strings in-place (#2235)String#unpack
, Array#pack
, String#chars
, String#length
, Number#chr
, and (only partially) String#+
are now encoding aware (#2235)String#inspect
now uses \x
for binary stirngs (#2235)if RUBY_ENGINE == "opal"
and friends are now outputing less JS code (#2159, #1965)Array
: to_a
, slice
/[]
, uniq
, *
, difference
/-
, intersection
/&
, union
/|
, flatten now return Array, not a subclass, as Ruby 3.0 does (#2237)Array
: difference
, intersection
, union
now accept multiple arguments (#2237)c_lexer
, it was optional and didn't work for the last few releases of parser (#2235)def a(...) puts(...) end
(#2153)(1..)
, (..1)
(#2150)**nil
argument - see #2240 to note limitations (#2152)Random::Formatters
which add methods #{hex,base64,urlsafe_base64,uuid,random_float,random_number,alphanumeric}
to Random
and SecureRandom
(#2218)"\x80"
syntax in String literals (#2235)String#+@
, String#-@
(#2235)begin <CODE> end while <CONDITION>
(#2255)Number#to_i
with huge number (#2191)String#start_with
(#2198)String#bytes
now works in strict mode (#2194)Array#unshift
on v8 > 7.1 (#2116)#initialize
with multiple arguments correctly (with a limitation caused by the String immutability issue, that a source string must be the first argument and #initialize
can't change its value) (#2238, #2185)String#unpack("U*")
on binary strings with latin1 high characters, fix performance regression on that call (#2235, #2189, #2129, #2099, #2094, #2000, #2128)String#to_json
output on some edge cases (#2235)String#b
no longer modifies object strings in-place (#2235)String#unpack
, Array#pack
, String#chars
, String#length
, Number#chr
, and (only partially) String#+
are now encoding aware (#2235)String#inspect
now uses \x
for binary stirngs (#2235)if RUBY_ENGINE == "opal"
and friends are now outputing less JS code (#2159, #1965)Array
: to_a
, slice
/[]
, uniq
, *
, difference
/-
, intersection
/&
, union
/|
, flatten now return Array, not a subclass, as Ruby 3.0 does (#2237)Array
: difference
, intersection
, union
now accept multiple arguments (#2237)c_lexer
, it was optional and didn't work for the last few releases of parser (#2235)uplevel:
keyword argument in Kernel#warn
(#2006)#respond_to_missing?
implementation for BasicObject
, Delegator
, OpenStruct
, that's meant for future support in the Opal runtime, which currently ignores it (#2007)Opal::Compiler#magic_comments
that allows to access magic-comments format and converts it to a hash (#2038)Opal.$$
is now a shortcut for Opal.const_get_relative
(#2038)Opal.$$$
is now a shortcut for Opal.const_get_qualified
(#2038)globalThis
as the generic global object accessor (#2047)Opal::Compiler#magic_comments
that allows to access magic-comments format and converts it to a hashOpal.$$
is now a shortcut for Opal.const_get_relative
Opal.$$$
is now a shortcut for Opal.const_get_qualified
-> { _1 + _2 }.call(3, 4) # => 7
(#2149)<internal:…>
and <js:…>
in stacktraces, like MRI we now distinguish internal lines from lib/app lines (#2154)Array#difference
, Array#intersection
, Array#union
as aliases respectively to Array#{-,&,|}
(#2151)filter{,!}
to select{,!}
throughout the corelib classes (#2151)Enumerable#filter_map
, Enumerable#tally
(#2151)Kernel#then
for Kernel#yield_self
(#2151){Proc,Method}#{<<,>>}
(#2151)use_strict
which can also be set by the use_strict
magic comment (#1959)--rbrequire (-q)
option to opal
command line executable (#2120)$$data
(#1995)PathReader
used to try to read missing files instead of respecting the missing_require_severity
configuration value (#2044)call { true or next }
producing invalid code (#2160)define_method
can now be called on the main object (#2029)Opal.$$
changed from being the constant cache of Object to being a shortcut for Opal.const_get_relative
(#2038)opal/repl.rb
(#2048)Encoding.default_external
is now initialized with __ENCODING__
(#2072)rescue => $gvar
(#2154)Comparable#clamp
to support a Range argument (#2151)#to_h
method to support a block (shortform for .map(&block).to_h
) (#2151)Opal.truthy?
and Opal.falsy?
helpers (#2076)tainting
compiler config option (#2072)--map
/ -P
CLI option was only working in conjunction with other options (#1974)Published by elia almost 5 years ago
Added Module#prepend
and completely overhauled the module and class inheritance system (#1826)
Methods and properties are now assigned with Object.defineProperty()
as non-enumerable (#1821)
Backtrace now includes the location inside the source file for syntax errors (#1814)
Added support for a faster C-implemented lexer, it's enough to add gem 'c_lexer
to the Gemfile
(#1806)
Added Date#to_n
that returns the JavaScript Date object (in native.rb). (#1779, #1792)
Added Array#pack
(supports only C, S, L, Q, c, s, l, q, A, a
formats). (#1723)
Added String#unpack
(supports only C, S, L, Q, S>, L>, Q>, c, s, l, q, n, N, v, V, U, w, A, a, Z, B, b, H, h, u, M, m
formats). (#1723)
Added File#symlink?
for Node.js. (#1725)
Added Dir#glob
for Node.js (does not support flags). (#1727)
Added support for a static folder in the "server" CLI runner via the OPAL_CLI_RUNNERS_SERVER_STATIC_FOLDER
env var
Added the CLI option --runner-options
that allows passing arbitrary options to the selected runner, currently the only runner making use of them is server
accepting port
and static_folder
Added a short helper to navigate constants manually: E.g. Opal.$$.Regexp.$$.IGNORECASE
(see docs for "Compiled Ruby")
Added initial support for OpenURI module (using XMLHttpRequest on browser and xmlhttprequest on Node). (#1735)
Added String#prepend
to the list of unsupported methods (because String are immutable in JavaScript)
Added methods (most introduced in 2.4/2.5):
Array#prepend
(#1757)Array#append
(#1757)Array#max
(#1757)Array#min
(#1757)Complex#finite?
(#1757)Complex#infinite?
(#1757)Complex#infinite?
(#1757)Date#to_time
(#1757)Date#next_year
(#1885)Date#prev_year
(#1885)Hash#slice
(#1757)Hash#transform_keys
(#1757)Hash#transform_keys!
(#1757)Numeric#finite?
(#1757)Numeric#infinite?
(#1757)Numeric#infinite?
(#1757)Integer#allbits?
(#1757)Integer#anybits?
(#1757)Integer#digits
(#1757)Integer#nobits?
(#1757)Integer#pow
(#1757)Integer#remainder
(#1757)Integer.sqrt
(#1757)Random.urandom
(#1757)String#delete_prefix
(#1757)String#delete_suffix
(#1757)String#casecmp?
(#1757)Kernel#yield_self
(#1757)String#unpack1
(#1757)String#to_r
(#1842)String#to_c
(#1842)String#match?
(#1842)String#unicode_normalize
returns self (#1842)String#unicode_normalized?
returns true (#1842)String#[]=
throws NotImplementedError
(#1836)Added support of the pattern
argument for Enumerable#all?
, Enumerable#any?
, Enumerable#none?
. (#1757)
Added ndigits
option support to Number#floor
, Number#ceil
, Number#truncate
. (#1757)
Added key
and receiver
attributes to the KeyError
. (#1757)
Extended Struct.new
to support keyword_init
option. (#1757)
Added a new Opal::Config.missing_require_severity
option and relative --missing-require
CLI flag. This option will command how the builder will behave when a required file is missing. Previously the behavior was undefined and partly controlled by dynamic_require_severity
. Not to be confused with the runtime config option Opal.config.missing_require_severity;
which controls the runtime behavior.
Added Matrix
(along with the internal MRI utility E2MM
)
Use shorter helpers for constant lookups, $$
for relative (nesting) lookups and $$$
for absolute (qualified) lookups
Add support for the Mersenne Twister random generator, the same used by CRuby/MRI (#657 & #1891)
[Nodejs] Added support for binary data in OpenURI
(#1911, #1920)
[Nodejs] Added support for binary data in File#read
(#1919, #1921)
[Nodejs] Added support for File#readlines
(#1882)
[Nodejs] Added support for ENV#[]
, ENV#[]=
, ENV#key?
, ENV#has_key?
, ENV#include?
, ENV#member?
, ENV#empty?
, ENV#keys
, ENV#delete
and ENV#to_s
(#1928)
.
) character is no longer replaced with [\s\S] in a multiline regexp passed to Regexp#match and Regexp#match? (#1796, #1795)
Kernel#format
(and sprintf
alias) are now in a dedicated module corelib/kernel/format
and available exclusively in opal
(#1930)
corelib/kernel
module and available in both opal
and opal/mini
--map
CLI option now works only in conjunction with --compile
(or --runner compiler
)node
CLI runner now adds its NODE_PATH
entry instead of replacing the ENV var altogether--disable-web-security
option flag to the Chrome headless runner to be able to do XMLHttpRequest
displayName
on functions and methods and more readable temp variable names (#1910)--server-port 1234
option is now deprecated in favor of using --runner-options='{"port": 1234}'
::Native
is now deprecated because it generates conflicts with core classes in constant lookups (both Native::Object
and Native::Array
exist). Instead Native::Werapper
should be used.node_require 'my_module'
to access the native require()
function in Node.js is deprecated in favor of `require('my_module')` because static builders need to parse the call in order to function (#1886).node
CLI runner no longer supports passing extra node options via the NODE_OPT
env var, instead Node.js natively supports the NODE_OPTIONS
env var.Opal::Hike
(#1881)Marshal::BinaryString
(#1914)Date#next_month
and Date#prev_month
. (#1757)pattern
argument handling for Enumerable#grep
and Enumerable#grep_v
. (#1757)ArgumentError
instead of TypeError
from Numeric#step
when step is not a number. (#1757)LoadError
wasn't being raised even with Opal.config.missing_require_severity;
set to 'error'
.Kernel#public_methods
to return instance methods if the argument is set to false. (#1848)String#gsub
that made it start an infinite loop when used recursively. (#1879)Kernel#exit
was using status 0 when a number or a generic object was provided, now accepts numbers and tries to convert objects with #to_int
(#1898, #1808).Method#to_proc
now correctly sets parameters and arity on the resulting Proc (#1903)String#to_proc
performance (#1888)Opal.ancestors()
now returns false for when provided with JS-falsy objects (#1839)::inherited
(#1838)String#to_sym
now returns the string literal (#1835)String#center
now correctly checks length (#1833)redo
inside while
now works properly (#1820)||=
assignments on constants when the constant is not yet defined (#1935)String#chomp
to return an empty String when arg == self
(#1936)Comparable
when <=>
does not return Numeric (#1945)Class#native_alias
error message (#1946)gmt_offset
(alias utc_offset
) should return 0 if the date is UTC (#1941)exceptionDetails.stackTrace
can be undefined (#1955)String#each_codepoint
and String#codepoints
(#1944, #1947)Exception.stack
, in some cases the backtrace was lost (#1963)String#ascii_only?
a little less wrong (#1951)::Native
(#1957)