assigns.push idx.compileToFragments o, LEVEL_LIST if expandedIdx
assigns.push vvar unless top or @subpattern
fragments = @joinFragmentArrays assigns, ', '
@@ -4987,11 +5001,11 @@ Assign
-
When compiling a conditional assignment, take care to ensure that the operands are only evaluated once, even though we have to reference them @@ -5005,11 +5019,11 @@
Assign
-Disallow conditional assignment of undefined variables.
@@ -5028,11 +5042,11 @@Assign
-Convert special math assignment operators like a **= b
to the equivalent
extended form a = a ** b
and then compiles that.
Assign
-Compile the assignment from an array splice literal, using JavaScript’s
Array#splice
method.
Assign
-FuncGlyph
@@ -5105,11 +5119,11 @@FuncGlyph
-Code
@@ -5118,11 +5132,11 @@Code
-A function definition. This is the only node that creates a new Scope. When for the purposes of walking the contents of a function body, the Code @@ -5160,11 +5174,11 @@
Code
-Compilation creates a new scope unless explicitly asked to share with the outer scope. Handles splat parameters in the parameter list by setting @@ -5199,11 +5213,11 @@
Code
-Check for duplicate parameters and separate this
assignments.
Code
-Parse the parameters, adding them to the list of parameters to put in the function definition; and dealing with splats or expansions, including @@ -5245,11 +5259,11 @@
Code
-Was ...
used with this parameter? (Only one such parameter is allowed
per function.) Splat/expansion parameters cannot have default values,
@@ -5269,11 +5283,11 @@
Code
-Splat arrays are treated oddly by ES; deal with them the legacy way in the function body. TODO: Should this be handled in the @@ -5298,11 +5312,11 @@
Code
-Parse all other parameters; if a splat paramater has not yet been encountered, add these other parameters to the list to be output in @@ -5318,11 +5332,11 @@
Code
-This parameter cannot be declared or assigned in the parameter list. So put a reference in the parameter list and add a statement @@ -5341,11 +5355,11 @@
Code
-If this parameter comes before the splat or expansion, it will go in the function definition parameter list.
@@ -5357,11 +5371,11 @@Code
-If this parameter has a default value, and it hasn’t already been
set by the shouldCache()
block above, define it as a statement in
@@ -5381,11 +5395,11 @@
Code
-Add this parameter’s reference(s) to the function scope.
@@ -5396,11 +5410,11 @@Code
-This parameter is destructured.
@@ -5411,11 +5425,11 @@Code
-Compile foo({a, b...}) ->
to foo(arg) -> {a, b...} = arg
.
Can be removed once ES proposal hits Stage 4.
Code
-Compile foo({a, b...} = {}) ->
to foo(arg = {}) -> {a, b...} = arg
.
Code
-This compilation of the parameter is only to get its name to add to the scope name tracking; since the compilation output here @@ -5474,11 +5488,11 @@
Code
-If this parameter had a default value, since it’s no longer in the function parameter list we need to assign its default value @@ -5494,11 +5508,11 @@
Code
-Add this parameter to the scope, since it wouldn’t have been added yet since it was skipped earlier.
@@ -5510,11 +5524,11 @@Code
-If there were parameters after the splat or expansion parameter, those parameters need to be assigned in the body of the function.
@@ -5526,11 +5540,11 @@Code
-Create a destructured assignment, e.g. [a, b, c] = [args..., b, c]
Code
-Add new expressions to the function body
@@ -5564,11 +5578,11 @@Code
-JavaScript doesn’t allow bound (=>
) functions to also be generators.
This is usually caught via Op::compileContinuation
, but double-check:
Code
-Assemble the output
@@ -5605,11 +5619,11 @@Code
-Block comments between a function name and (
get output between
function
and (
.
Code
-Compile this parameter, but if any generated variables get created
(e.g. ref
), shift those into the parent scope since we can’t put a
@@ -5647,11 +5661,11 @@
Code
-Block comments between )
and ->
/=>
get output between )
and {
.
Code
-We need to compile the body before method names to ensure super
references are handled.
Code
-Short-circuit traverseChildren
method to prevent it from crossing scope
boundaries unless crossScope
is true
.
Code
-Short-circuit replaceInContext
method to prevent it from crossing context boundaries. Bound
functions have the same context.
Code
-Find all super calls in the given context node;
returns true
if iterator
is called.
Code
-super
in a constructor (the only super
without an accessor)
cannot be given an argument with a reference to this
, as that would
@@ -5798,11 +5812,11 @@
Code
-super
has the same target in bound (arrow) functions, so check them too
Code
-Param
@@ -5828,11 +5842,11 @@Param
-A parameter in a function definition. Beyond a typical JavaScript parameter, these parameters can also attach themselves to the context of the function, @@ -5877,11 +5891,11 @@
Param
-Iterates the name or names of a Param
.
In a sense, a destructured parameter represents multiple JS parameters. This
@@ -5898,11 +5912,11 @@
Param
-- simple literals
foo
@@ -5915,11 +5929,11 @@ - +
-
- at-params
@foo
@@ -5933,11 +5947,11 @@ - +
-
- destructured parameter with default value @@ -5951,11 +5965,11 @@
- +
-
- assignments within destructured parameters
{foo:bar}
@@ -5968,11 +5982,11 @@ - +
-
… possibly with a default value
@@ -5987,11 +6001,11 @@Param
-- +
- splats within destructured parameters
[xs...]
@@ -6007,11 +6021,11 @@ - +
-
- destructured parameters within destructured parameters
[{a}]
@@ -6025,11 +6039,11 @@ - +
-
- at-params within destructured parameters
{@foo}
@@ -6043,11 +6057,11 @@ - +
-
- simple destructured parameters {foo} @@ -6065,11 +6079,11 @@
- +
-
Rename a param by replacing the given AST node for a name with a new node. This needs to ensure that the the source for object destructuring does not change.
@@ -6091,11 +6105,11 @@Param
-- +
Splat
@@ -6104,11 +6118,11 @@Splat
-- +
A splat, either as a parameter to a function, an argument to a call, or as part of a destructuring assignment.
@@ -6136,11 +6150,11 @@Splat
-- +
Expansion
@@ -6149,11 +6163,11 @@Expansion
-- +
Used to skip values inside an array destructuring (pattern matching) or parameter list.
@@ -6175,11 +6189,11 @@Expansion
-- +
Elision
@@ -6188,11 +6202,11 @@Elision
-- +
Array elision element (for example, [,a, , , b, , c, ,]).
@@ -6220,11 +6234,11 @@Elision
-- +
While
@@ -6233,11 +6247,11 @@While
-- +
A while loop, the only sort of low-level loop exposed by CoffeeScript. From it, all other loops can be manufactured. Useful in cases where you need more @@ -6276,11 +6290,11 @@
While
-- +
The main difference from a JavaScript while is that the CoffeeScript while can be used as a part of a larger expression – while loops may @@ -6313,11 +6327,11 @@
While
-- +
Op
@@ -6326,11 +6340,11 @@Op
-- +
Simple Arithmetic and logical operations. Performs some conversion from CoffeeScript operations into their JavaScript equivalents.
@@ -6358,11 +6372,11 @@Op
-- +
The map of conversions from CoffeeScript to JavaScript symbols.
@@ -6377,11 +6391,11 @@Op
-- +
The map of invertible operators.
@@ -6412,11 +6426,11 @@Op
-- +
Am I capable of Python-style comparison chaining?
@@ -6478,11 +6492,11 @@Op
-- +
Param
-
Param
- - at-params within destructured parameters
Param
- - destructured parameters within destructured parameters
Param
-
Param
- - assignments within destructured parameters
Param
-
Param
- - at-params