CS-Notes/docs/_style/prism-master/tests/languages/javascript/issue1526.test

36 lines
813 B
Plaintext
Raw Normal View History

2018-12-19 14:09:39 +08:00
fetch('some-resource.json')
.then(response => response.json())
.catch(console.error);
----------------------------------------------------
[
["function", "fetch"],
["punctuation", "("],
["string", "'some-resource.json'"],
["punctuation", ")"],
["punctuation", "."],
["function", "then"],
["punctuation", "("],
["parameter", ["response"]],
["operator", "=>"],
" response",
["punctuation", "."],
["function", "json"],
["punctuation", "("],
["punctuation", ")"],
["punctuation", ")"],
["punctuation", "."],
["function", "catch"],
["punctuation", "("],
"console",
["punctuation", "."],
"error",
["punctuation", ")"],
["punctuation", ";"]
]
----------------------------------------------------
Checks for catch function which is not a keyword. See #1526