Skip to content

Commit

Permalink
Renovate irrelevant/outdated error pages (#34780)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Jul 11, 2024
1 parent 67606b0 commit bd401d0
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 304 deletions.
2 changes: 2 additions & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12508,7 +12508,9 @@
/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal /en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal_literal
/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_toLocaleFormat /en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features
/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_formal_parameter /en-US/docs/Web/JavaScript/Reference/Errors/Missing_formal_parameter
/en-US/docs/Web/JavaScript/Reference/Errors/Missing_semicolon_before_statement /en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_token
/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_codepoint /en-US/docs/Web/JavaScript/Reference/Errors/Not_a_valid_code_point
/en-US/docs/Web/JavaScript/Reference/Errors/Unterminated_string_literal /en-US/docs/Web/JavaScript/Reference/Errors/String_literal_EOL
/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope /en-US/docs/Web/JavaScript/Reference/Functions
/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode /en-US/docs/Web/JavaScript/Reference/Strict_mode
/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/Strict_mode/Transitioning_to_strict_mode /en-US/docs/Web/JavaScript/Reference/Strict_mode
Expand Down
31 changes: 4 additions & 27 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -103945,10 +103945,6 @@
"modified": "2020-11-30T05:50:18.195Z",
"contributors": ["mfuji09", "fscholz"]
},
"Web/JavaScript/Reference/Errors/Equal_as_assign": {
"modified": "2020-04-16T08:23:11.906Z",
"contributors": ["fscholz", "arai"]
},
"Web/JavaScript/Reference/Errors/Getter_only": {
"modified": "2020-05-06T10:16:12.614Z",
"contributors": ["fscholz", "PatrickKettner"]
Expand Down Expand Up @@ -104051,21 +104047,6 @@
"modified": "2020-05-06T09:40:23.426Z",
"contributors": ["fscholz", "PatrickKettner"]
},
"Web/JavaScript/Reference/Errors/Missing_semicolon_before_statement": {
"modified": "2020-04-16T07:49:53.557Z",
"contributors": [
"fscholz",
"sideshowbarker",
"kevinbmagill",
"SphinxKnight",
"ogigpermana",
"luisvallejomohl",
"PatrickKettner",
"nmve",
"jwhitlock",
"loveabushu1"
]
},
"Web/JavaScript/Reference/Errors/More_arguments_needed": {
"modified": "2020-05-06T09:46:25.163Z",
"contributors": ["fscholz", "Bzbarsky", "PatrickKettner"]
Expand Down Expand Up @@ -104200,6 +104181,10 @@
"modified": "2020-04-15T11:09:10.798Z",
"contributors": ["fscholz", "PatrickKettner", "nmve", "nbp", "arai"]
},
"Web/JavaScript/Reference/Errors/String_literal_EOL": {
"modified": "2020-04-16T08:26:04.965Z",
"contributors": ["fscholz", "PatrickKettner", "neroshan12", "nmve"]
},
"Web/JavaScript/Reference/Errors/Too_much_recursion": {
"modified": "2020-04-14T12:37:45.784Z",
"contributors": [
Expand All @@ -104216,10 +104201,6 @@
"modified": "2020-06-04T08:11:57.239Z",
"contributors": ["Sheppy", "fscholz", "ZavodPodushek", "nmve"]
},
"Web/JavaScript/Reference/Errors/Undefined_prop": {
"modified": "2020-10-24T03:39:49.210Z",
"contributors": ["angleKH", "fscholz", "arai", "fiejen", "nmve", "Sheppy"]
},
"Web/JavaScript/Reference/Errors/Unexpected_token": {
"modified": "2020-04-15T11:24:29.836Z",
"contributors": [
Expand Down Expand Up @@ -104252,10 +104233,6 @@
"modified": "2020-04-16T07:01:37.303Z",
"contributors": ["fscholz", "wbamberg", "PatrickKettner"]
},
"Web/JavaScript/Reference/Errors/Unterminated_string_literal": {
"modified": "2020-04-16T08:26:04.965Z",
"contributors": ["fscholz", "PatrickKettner", "neroshan12", "nmve"]
},
"Web/JavaScript/Reference/Errors/in_operator_no_object": {
"modified": "2020-12-06T05:37:14.314Z",
"contributors": [
Expand Down
22 changes: 2 additions & 20 deletions files/en-us/learn/javascript/first_steps/what_went_wrong/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,6 @@ Try updating both lines like this, then save and refresh — the game should now
There are other common errors you'll come across in your code. This section highlights most of them.

### SyntaxError: missing ; before statement

This error generally means that you have missed a semicolon at the end of one of your lines of code, but it can sometimes be more cryptic. For example, if we change this line inside the `checkGuess()` function:

```js
const userGuess = Number(guessField.value);
```

to

```js example-bad
const userGuess === Number(guessField.value);
```

It throws this error because it thinks you are trying to do something different. You should make sure that you don't mix up the assignment operator (`=`) — which sets a variable to be equal to a value — with the strict equality operator (`===`), which tests whether one value is equal to another, and returns a `true`/`false` result.
> **Note:** See our [SyntaxError: missing ; before statement](/en-US/docs/Web/JavaScript/Reference/Errors/Missing_semicolon_before_statement) reference page for more details about this error.
### The program always says you've won, regardless of the guess you enter
This could be another symptom of mixing up the assignment and strict equality operators. For example, if we were to change this line inside `checkGuess()`:
Expand Down Expand Up @@ -254,13 +236,13 @@ This has caused the browser to think that we are trying to pass the contents of
This is easy — it generally means that you've missed one of your curly braces from a function or conditional structure. We got this error by deleting one of the closing curly braces near the bottom of the `checkGuess()` function.
### SyntaxError: expected expression, got '_string_' or SyntaxError: unterminated string literal
### SyntaxError: expected expression, got '_string_' or SyntaxError: string literal contains an unescaped line break
These errors generally mean that you've left off a string value's opening or closing quote mark. In the first error above, _string_ would be replaced with the unexpected character(s) that the browser found instead of a quote mark at the start of a string. The second error means that the string has not been ended with a quote mark.
For all of these errors, think about how we tackled the examples we looked at in the walkthrough. When an error arises, look at the line number you are given, go to that line and see if you can spot what's wrong. Bear in mind that the error is not necessarily going to be on that line, and also that the error might not be caused by the exact same problem we cited above!
> **Note:** See our [SyntaxError: Unexpected token](/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_token) and [SyntaxError: unterminated string literal](/en-US/docs/Web/JavaScript/Reference/Errors/Unterminated_string_literal) reference pages for more details about these errors.
> **Note:** See our [SyntaxError: Unexpected token](/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_token) and [SyntaxError: string literal contains an unescaped line break](/en-US/docs/Web/JavaScript/Reference/Errors/String_literal_EOL) reference pages for more details about these errors.
## Summary
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ page-type: javascript-error

{{jsSidebar("Errors")}}

The JavaScript exception "illegal character" occurs when there is an invalid or
unexpected token that doesn't belong at this position in the code.
The JavaScript exception "illegal character" occurs when the [lexer](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar) reads a character that's not part of a string literal, and the character cannot constitute a valid token in the language.

## Message

```plain
SyntaxError: Invalid character (Edge)
SyntaxError: illegal character (Firefox)
SyntaxError: Invalid or unexpected token (Chrome)
SyntaxError: Invalid or unexpected token (V8-based)
SyntaxError: illegal character U+201C (Firefox)
SyntaxError: Invalid character '\u201c' (Safari)
```

## Error type
Expand All @@ -23,8 +22,7 @@ SyntaxError: Invalid or unexpected token (Chrome)

## What went wrong?

There is an invalid or unexpected token that doesn't belong at this position in the
code. Use an editor that supports syntax highlighting and carefully check your code
There is an invalid character that the interpreter doesn't understand. You should either put it in a string literal or replace it with another character. Use an editor that supports syntax highlighting and carefully check your code
against mismatches like a minus sign (`-`) versus a dash (``)
or simple quotes (`"`) versus non-standard quotation marks (`"`).

Expand Down Expand Up @@ -62,14 +60,14 @@ Some editors and IDEs will notify you or at least use a slightly different highl
It's easy to forget a character here or there.

```js-nolint example-bad
const colors = ["#000", #333", "#666"];
// SyntaxError: illegal character
const operators = ["+", "-", ×", "÷"];
// SyntaxError: illegal character U+00D7
```

Add the missing quote for `"#333"`.
Add the missing quote for `"×"`.

```js example-good
const colors = ["#000", "#333", "#666"];
const operators = ["+", "-", "×", "÷"];
```

### Hidden characters
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
title: "SyntaxError: unterminated string literal"
slug: Web/JavaScript/Reference/Errors/Unterminated_string_literal
title: "SyntaxError: string literal contains an unescaped line break"
slug: Web/JavaScript/Reference/Errors/String_literal_EOL
page-type: javascript-error
---

{{jsSidebar("Errors")}}

The JavaScript error "unterminated string literal" occurs when there is an unterminated
The JavaScript error "string literal contains an unescaped line break" occurs when there is an unterminated
[string literal](/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#string_literals) somewhere. String literals must be enclosed by single
(`'`) or double (`"`) quotes.
(`'`) or double (`"`) quotes and cannot split across multiple lines.

## Message

```plain
SyntaxError: Unterminated string constant (Edge)
SyntaxError: unterminated string literal (Firefox)
SyntaxError: Invalid or unexpected token (V8-based)
SyntaxError: '' string literal contains an unescaped line break (Firefox)
SyntaxError: Unexpected EOF (Safari)
```

## Error type
Expand Down
Loading

0 comments on commit bd401d0

Please sign in to comment.