File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1191,7 +1191,7 @@ let emptyObject = { ...null, ...undefined }; // 不报错
1191
1191
let aWithXGetter = {
1192
1192
... a,
1193
1193
get x () {
1194
- throws new Error (' not thrown yet' );
1194
+ throw new Error (' not throw yet' );
1195
1195
}
1196
1196
};
1197
1197
@@ -1200,7 +1200,7 @@ let runtimeError = {
1200
1200
... a,
1201
1201
... {
1202
1202
get x () {
1203
- throws new Error (' thrown now' );
1203
+ throw new Error (' throw now' );
1204
1204
}
1205
1205
}
1206
1206
};
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ JavaScript 语言的正则表达式,只支持先行断言(lookahead)和先
367
367
/ \d + (?!%)/ .exec (' that’s all 44 of them' ) // ["44"]
368
368
```
369
369
370
- 上面两个字符串,如果互换正则表达式,就会匹配失败 。另外,还可以看到,”先行断言“括号之中的部分(` (?=%) ` ),是不计入返回结果的。
370
+ 上面两个字符串,如果互换正则表达式,就不会得到相同结果 。另外,还可以看到,”先行断言“括号之中的部分(` (?=%) ` ),是不计入返回结果的。
371
371
372
372
“后行断言”正好与“先行断言”相反,` x ` 只有在` y ` 后面才匹配,必须写成` /(?<=y)x/ ` 。比如,只匹配美元符号之后的数字,要写成` /(?<=\$)\d+/ ` 。”后行否定断言“则与”先行否定断言“相反,` x ` 只有不在` y ` 后面才匹配,必须写成` /(?<!y)x/ ` 。比如,只匹配不在美元符号后面的数字,要写成` /(?<!\$)\d+/ ` 。
373
373
You can’t perform that action at this time.
0 commit comments