Changelog: swc v1.1.4
#
loose modeswc
now has a loose mode, just like babel 2015 transform.
See doc for more detail.
#489)#
Lots of bug fix (I copied almost all tests from babel, and fixed lots of bugs.
#
resolver passResolver pass, along with hygiene and fixer, is core of the swc.
#
Handle object literals correctlyPreviously, key of an object literal may interfere with outer identifiers. It means,
Second usage of b
could be interfered by b
in a
. swc
now hanldes it correctly.
#
hygiene pass#
Renaming of computed property namePreviously,
(where #n is hygiene number)
was compiled to
which results in a bug. It is now compiled as
#
fixer pass#
export default expressionThe arrow expression lke
and sequence expression like
is now wrapped with a parenthesis.
#
sequence expression in an arrow expressionPreviously
was compiled as
which is wrong.
swc
now compiles it as
#
classes pass#
Handle super accesses correctlyswc
now handles all valid super accesses. It includes something strange like
#
computed_properties pass#
Better codegenis now compiled as
instead of
#
destructuring pass#
for-of, for-in loop supportFrom now, for-of loop and for-in are supported.
#
loose mode is hereIf you want smaller output, you can turn on loose mode.
#
for_of pass#
assume_array mode is hereIf you want smaller output, you can turn on assume_array by enabling loose mode.
#
labelled for loop is handled correctlyPreviously, label was stripped out without any error message, and it resulted in a runtime error. swc
now handles labaelled loops correctly.
#
spread pass#
loose mode is hereIf you don't want _toConsumableArray
in output, you can turn on loose mode.
#
template_literal pass#
Performancetemplate_literal
pass become much more performant by removing redundant .clone()
s.
#
LiteralThe pass try it's best to reduce template literals into constant.
is compiled as
#
CachingFunctions generated for tagged template literals are cached. This behavior is same as it of babel.
#
class_properties passthis
inside static properties#
Handle swc
can now handle
#
Handle private field in complex assignmentswc
can now handle
#
Handle super access in propertiesswc
now can handle
#
Handle complex super initializationswc
now can handle
#
object rest spread pass#
Computed key with side effectswc
can now handle complex object pattern like
#
Destructuring nullnow throws an error, instead of being silent.
#
async_to_generator pass#
Efficient handling of simple async functionsswc
now emits minimal output for
#
Correct number of parametersswc
now convert async functions in a way that preserves function.length.