Skip to content

Commit 2c07463

Browse files
committed
Revert changes related to Chinese text
So that it looks readable again Issue marijnh#327
1 parent 0e11bba commit 2c07463

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

02_program_structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ If you are unsure how to try your solutions to exercises, refer to the
910910
Each exercise starts with a problem description. Read that and try to
911911
solve the exercise. If you run into problems, consider reading the
912912
hints [after the exercise]{if interactive}[at the [end of the
913-
book](hints.html#hints)]{if book}. Full solutions to the exercises are
913+
book](hints)]{if book}. Full solutions to the exercises are
914914
not included in this book, but you can find them online at
915915
[_eloquentjavascript.net/code_](http://eloquentjavascript.net/code).
916916
If you want to learn something from the exercises, I recommend looking

04_data.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ That takes care of the cat and tree problems. But Jacques would prefer
6060
to get rid of his condition entirely. The irregular occurrences of the
6161
transformation make him suspect that they might be triggered by
6262
something. For a while, he believed that it happened only on days when
63-
he had been near oak trees. But avoiding oak trees did not cause the
64-
problem to stop.
63+
he had been near oak trees. But avoiding oak trees did not stop the
64+
problem.
6565

6666
{{index journal}}
6767

@@ -78,8 +78,8 @@ information.
7878
{{index "data structure"}}
7979

8080
To work with a chunk of digital data, we'll first have to find a way
81-
to represent it in our machine's ((memory)). Say, as an example, that
82-
we want to represent a ((collection)) of numbers: 2, 3, 5, 7, and 11.
81+
to represent it in our machine's ((memory)). Say, for example, that we
82+
want to represent a ((collection)) of the numbers 2, 3, 5, 7, and 11.
8383

8484
{{index string}}
8585

@@ -116,9 +116,9 @@ _((index))_ given by the expression in the brackets.
116116
{{index "zero-based counting"}}
117117

118118
The first index of an array is zero, not one. So the first element is
119-
read with `listOfNumbers[0]`. This convention takes some getting used
120-
to. Zero-based counting has a long tradition in technology, and in
121-
certain ways makes a lot of sense. Think of the index as the amount of
119+
retrieved with `listOfNumbers[0]`. Zero-based counting has a long
120+
tradition in technology, and in certain ways makes a lot of sense, but
121+
it takes some getting used to. Think of the index as the amount of
122122
items to skip, counting from the start of the array.
123123

124124
{{id properties}}
@@ -129,11 +129,11 @@ items to skip, counting from the start of the array.
129129

130130
We've seen a few suspicious-looking expressions like `myString.length`
131131
(to get the length of a string) and `Math.max` (the maximum function)
132-
in past examples. These are expressions that access a _((property))_
132+
in past chapters. These are expressions that access a _((property))_
133133
of some value. In the first case, we access the `length` property of
134134
the value in `myString`. In the second, we access the property named
135135
`max` in the `Math` object (which is a collection of
136-
mathematics-related values and functions).
136+
mathematics-related constants and functions).
137137

138138
{{index property, null, undefined}}
139139

@@ -143,13 +143,13 @@ these nonvalues, you get an error.
143143

144144
```{test: no}
145145
null.length;
146-
// → TypeError: Cannot read property 'length' of null
146+
// → TypeError: null has no properties
147147
```
148148

149149
{{indexsee "dot character", "period character"}}
150150
{{index "[] (subscript)", "period character", "square brackets", "computed property"}}
151151

152-
The two main ways to access properties in JavaScript are with a dot
152+
The two typical ways to access properties in JavaScript are with a dot
153153
and with square brackets. Both `value.x` and `value[x]` access a
154154
((property)) on `value`—but not necessarily the same property. The
155155
difference is in how `x` is interpreted. When using a dot, the word
@@ -160,10 +160,10 @@ named "x", `value[x]` tries to evaluate the expression `x` and uses
160160
the result as the property name.
161161

162162
So if you know that the property you are interested in is called
163-
"length", you say `value.length`. If you want to extract the property
163+
"name", you say `value.name`. If you want to extract the property
164164
named by the value held in the binding `i`, you say `value[i]`.
165-
Property names can be any string, and the dot notation only allows
166-
names that look like valid binding names, so if you want to access a
165+
Property names can be any string, but the dot notation only works with
166+
names that look like valid binding names. So if you want to access a
167167
property named "2" or "John Doe", you must use square brackets:
168168
`value[2]` or `value["John Doe"]`.
169169

@@ -177,9 +177,10 @@ anyway, you have to use the bracket notation to get at them.
177177
The `length` property of an array tells us how many elements it has.
178178
This property name is a valid binding name, and we know its name in
179179
advance, so to find the length of an array, you typically write
180-
`array.length` because it is easier to write than `array["length"]`.
180+
`array.length` because that's easier to write than `array["length"]`.
181181

182182
{{id methods}}
183+
183184
## Methods
184185

185186
{{index [function, "as property"], method, string}}
@@ -209,7 +210,7 @@ value whose property we called. How this works is described in
209210
[Chapter ?](object#obj_methods).
210211

211212
Properties that contain functions are generally called _methods_ of
212-
the value they belong to. As in, "_toUpperCase_ is a method of a
213+
the value they belong to. As in, "`toUpperCase` is a method of a
213214
string".
214215

215216
{{id array_methods}}

pdf/book.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
\usepackage{hyperref}
66
\usepackage{bookmark}
77
\usepackage{ucharclasses}
8+
\usepackage{xeCJK}
89
\usepackage{fontspec}
910
\usepackage{listings}
1011
\usepackage{graphicx}
@@ -31,21 +32,19 @@
3132
^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
3233
^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
3334
^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff%
34-
🐴👟🌹🐉🍎😎🎈💥🖌💾📁🎨🦆тяв英国俄罗斯的狗说
35+
🐴👟🌹🐉🍎😎🎈💥🖌💾📁🎨🦆тяв
3536
^^00}
3637
\lst@RestoreCatcodes
3738

3839
\setcounter{secnumdepth}{0}
3940
\setcounter{tocdepth}{1}
4041
\setmonofont[Scale=0.8]{Inconsolata.otf}
4142
\newfontfamily{\cyrillic}{CMU Serif}
42-
\defaultfontfeatures[\cjkfont]{Scale=0.55}
43-
\newfontfamily{\cjkfont}{FandolSong}
44-
\defaultfontfeatures[\emojifont]{Scale=1.15,FakeBold=1.25}
43+
\defaultfontfeatures[\emojifont]{Scale=1.15}
4544
\newfontface{\emojifont}{Symbola_hint.ttf}
4645
\setTransitionsFor{MiscellaneousSymbolsAndPictographs}{\emojifont}{\normalfont}{}
4746
\setTransitionsForCyrillics{\cyrillic}{}
48-
\setTransitionsForCJK{\cjkfont}{}
47+
\setTransitionsFor{CJK}{\emojifont}{}
4948
\pagestyle{plain}
5049
\makeatother
5150

0 commit comments

Comments
 (0)