Skip to content

Commit 2a2cb15

Browse files
authored
Pass-through for generator stars in code. (#39)
1 parent c354744 commit 2a2cb15

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ch04.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ Generators ((("generators", id="gen4")))are a new feature in ES6. The way they w
10681068

10691069
We ((("generators", "fundamentals", id="gen4f")))already examined iterators in the previous section, learning how their `.next()` method is called one at a time to pull values from a sequence. Instead of a `next` method whenever you return a value, generators use the `yield` ((("yield")))keyword to add values into the sequence.
10701070

1071-
Here is an example generator function. Note the `+*+` after `function`. That's ((("function*")))not a typo, that's how you mark a generator function as a generator.
1071+
Here is an example generator function. Note the pass:[<code>*</code>] after `function`. That's ((("function*")))not a typo, that's how you mark a generator function as a generator.
10721072

10731073
[source,javascript]
10741074
----

ch08.asciidoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ console.log(union([1, 2], 2))
4545
====
4646
We can omit the ((("CommonJS", "file extension use")))file extension as long as it's _.js_ or _.json_, but this is discouraged.
4747
48-
While the file extension is optional for `require` statements and when using the `node` CLI, we should strongly consider getting into the habit of including it nevertheless. https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system[Browser implementations of ESM] won't have this luxury, since that'd entail extra roundtrips to figure out the correct endpoint for a JavaScript module HTTP resource.
48+
While the file extension is optional for `require` statements and when using the `node` CLI, we should strongly consider getting into the habit of including it nevertheless. https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-module-system[Browser implementations of ESM] won't have this luxury, since that'd entail extra roundtrips to figure out the correct endpoint for a JavaScript module HTTP resource.
4949
====
5050

5151
We could run `_app.js_` in its current state through the CLI for Node.js, `node`, as seen in the next snippet.
@@ -507,7 +507,7 @@ Lastly, there are also namespace ((("import statements", "named exports", startr
507507

508508
===== Wildcard import statements
509509

510-
We can ((("import statements", "wildcards")))((("wildcard import statements")))import the namespace object for a module by using a wildcard. Instead of importing the named exports or the default value, it imports everything at once. Note that the `*` must be followed by an alias where all the bindings will be placed. If there was a `default` export, it'll be placed in the namespace binding ((("ES6 modules", "import statements", startref="esm8is")))((("import statements", startref="is8")))as well.
510+
We can ((("import statements", "wildcards")))((("wildcard import statements")))import the namespace object for a module by using a wildcard. Instead of importing the named exports or the default value, it imports everything at once. Note that the pass:[<code>*</code>] must be followed by an alias where all the bindings will be placed. If there was a `default` export, it'll be placed in the namespace binding ((("ES6 modules", "import statements", startref="esm8is")))((("import statements", startref="is8")))as well.
511511

512512

513513
[source,javascript]

0 commit comments

Comments
 (0)