Opal v1.1.0 Release Notes
Release Date: 2021-02-19 // about 3 years ago-
โ Added
- ๐ Basic support for
uplevel:
keyword argument inKernel#warn
(#2006) - Added a
#respond_to_missing?
implementation forBasicObject
,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)- ๐ Use magic-comments to declare helpers required by the file (#2038)
Opal.$$
is now a shortcut forOpal.const_get_relative
(#2038)Opal.$$$
is now a shortcut forOpal.const_get_qualified
(#2038)- โ Added support for
globalThis
as the generic global object accessor (#2047) Opal::Compiler#magic_comments
that allows to access magic-comments format and converts it to a hash- ๐ Use magic-comments to declare helpers required by the file
Opal.$$
is now a shortcut forOpal.const_get_relative
Opal.$$$
is now a shortcut forOpal.const_get_qualified
- 0๏ธโฃ Source-map support for Node.js in the default runner (#2045)
- SecureRandom#hex(n) (#2050)
- โ Added a generic implementation of Kernel#caller and #warn(uplevel:) that works with sourcemaps in Node.js and Chrome (#2065)
- Added support for numblocks
-> { _1 + _2 }.call(3, 4) # => 7
(#2149) - ๐ Support
<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 toArray#{-,&,|}
(#2151)- Aliases
filter{,!}
toselect{,!}
throughout the corelib classes (#2151) Enumerable#filter_map
,Enumerable#tally
(#2151)- Alias
Kernel#then
forKernel#yield_self
(#2151) - Method chaining:
{Proc,Method}#{<<,>>}
(#2151) - โ Added Integer#to_d (#2006)
- Added a compiler option
use_strict
which can also be set by theuse_strict
magic comment (#1959) - โ Add
--rbrequire (-q)
option toopal
command line executable (#2120)
๐ Fixed
- Array#delete_if (#2069)
- Array#keep_if (#2069)
- Array#reject! (#2069)
- Array#select! (#2069)
- Struct#dup (#1995)
- Integer#gcdlcm (#1972)
- Enumerable#to_h (#1979)
- Enumerator#size (#1980)
- Enumerable#min (#1982)
- Enumerable#min_by (#1985)
- Enumerable#max_by (#1985)
- Set#intersect? (#1988)
- Set#disjoint? (#1988)
- Set#keep_if (#1987)
- Set#select! (#1987)
- Set#reject! (#1987)
- String#unicode_normalize (#2175)
- Module#alias_method (#1983)
- Enumerable#minmax_by (#1981)
- Enumerator#each_with_index (#1990)
- Range#== (#1992)
- Range#each (#1991)
- Enumerable#zip (#1986)
- String#getbyte (#2141)
- Struct#dup not copying
$$data
(#1995) - ๐ Fixed usage of semicolon in single-line backticks (#2004)
- Module#attr with multiple arguments (#2003)
PathReader
used to try to read missing files instead of respecting themissing_require_severity
configuration value (#2044)- โ Removed some unused variables from the runtime (#2052)
- ๐ Fixed a typo in the runtime (#2054)
- ๐ Fix Regexp interpolation, previously interpolating with other regexps was broken (#2062)
- Set match on StringScanner#skip and StringScanner#scan_until (#2061)
- ๐ Fix ruby 2.7 warnings (#2071)
- ๐ Improve the --help descriptions (#2146)
- โ Remove BasicObject#class (#2166)
- Time#strftime %j leading zeros (#2161)
- ๐ Fix
call { true or next }
producing invalid code (#2160) define_method
can now be called on the main object (#2029)- ๐ Fix nested for-loops (#2033)
- ๐ Fix Number#round for Integers (#2030)
- ๐ Fix parsing Unicode characters from Opal (#2073)
- Integer#===: improve Integer recognition (#2089)
- Regexp: ensure ignoreCase is never undefined (#2098)
- Hash#delete: ensure String keys are converted to values (#2106)
- ๐ Array#shift: improve performance on v8 >7.1 (#2115)
- ๐ Array#pop(1): improve performance (#2130)
- Object#pretty_inspect (#2139)
- ๐ Fix conversion from UTF-8 to bytes (#2138)
- โช Restore compatibility with Chrome 38, used by Cordova and many mobile browsers (#2109)
๐ Changed
- โก๏ธ Updated outdated parser version (#2013)
- ๐ Nashorn has been deprecated but GraalVM still supports it (#1997)
- "opal/mini" now includes "opal/io" (#2002)
- Regexps assigned to constants are now frozen (#2007)
Opal.$$
changed from being the constant cache of Object to being a shortcut forOpal.const_get_relative
(#2038)- ๐ Moved REPL implementation from bin/ to its own lib/ file as
opal/repl.rb
(#2048) Encoding.default_external
is now initialized with__ENCODING__
(#2072)- Keep the MersenneTwister implementation private (#2108)
- ๐ Change parser to 3.0 (#2148)
- ๐ Fix forwarding a rescued error to a global var:
rescue => $gvar
(#2154) - ๐ Now using Parser v3.0 and targeting Ruby 3.0 (#2156)
- ๐
Comparable#clamp
to support a Range argument (#2151) - ๐
#to_h
method to support a block (shortform for.map(&block).to_h
) (#2151) - BigDecimal is now a subclass of Numeric (#2006)
- ๐ PP to be rebased on upstream Ruby version (#2083)
- 0๏ธโฃ String to report UTF-8 encoding by default, as MRI does (#2117)
- โ Don't output "Failed to load WithCLexer, using pure Ruby lexer" warning unless in $DEBUG mode (#2174)
๐ Deprecated
- ๐ Requiring nodejs/stacktrace has been deprecated, source-maps are already supported by the default Node.js runner or by requiring https://github.com/evanw/node-source-map-support before loading code compiled by Opal (#2045)
โ Removed
- ๐ Basic support for