From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- .../bg/web/javascript/reference/errors/index.html | 31 ---------- .../reference/errors/unexpected_type/index.html | 70 ---------------------- 2 files changed, 101 deletions(-) delete mode 100644 files/bg/web/javascript/reference/errors/index.html delete mode 100644 files/bg/web/javascript/reference/errors/unexpected_type/index.html (limited to 'files/bg/web/javascript/reference/errors') diff --git a/files/bg/web/javascript/reference/errors/index.html b/files/bg/web/javascript/reference/errors/index.html deleted file mode 100644 index c295fccea6..0000000000 --- a/files/bg/web/javascript/reference/errors/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: JavaScript error reference -slug: Web/JavaScript/Reference/Errors -tags: - - Debugging - - Error - - Errors - - Exception - - JavaScript - - NeedsTranslation - - TopicStub - - exceptions -translation_of: Web/JavaScript/Reference/Errors ---- -

{{jsSidebar("Errors")}}

- -

Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors. Each error is an object based upon the {{jsxref("Error")}} object, and has a name and a message.

- -

Errors displayed in the Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code.

- -

List of errors

- -

In this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). Together, these two properties provide a starting point toward understanding and resolving the error. For more information, follow the links below!

- -

{{ListSubPages("/en-US/docs/Web/JavaScript/Reference/Errors")}}

- -

See also

- - diff --git a/files/bg/web/javascript/reference/errors/unexpected_type/index.html b/files/bg/web/javascript/reference/errors/unexpected_type/index.html deleted file mode 100644 index 372560f00e..0000000000 --- a/files/bg/web/javascript/reference/errors/unexpected_type/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: 'TypeError: "x" is (not) "y"' -slug: Web/JavaScript/Reference/Errors/Unexpected_type -tags: - - JavaScript - - TypeError - - Грешки -translation_of: Web/JavaScript/Reference/Errors/Unexpected_type ---- -
{{jsSidebar("Errors")}}
- -

Съобщение

- -
TypeError: "x" is (not) "y"
-
-Примери:
-TypeError: "x" is undefined
-TypeError: "x" is null
-TypeError: "undefined" is not an object
-TypeError: "x" is not an object or null
-TypeError: "x" is not a symbol
-
- -

Вид на грешката

- -

{{jsxref("TypeError")}}.

- -

Какво се обърка?

- -

Върнатият тип не отговаря на очакванията. Това се случва често при върната стойност {{jsxref("undefined")}} или {{jsxref("null")}}.

- -

Някои методи като {{jsxref("Object.create()")}} или {{jsxref("Symbol.keyFor()")}} освен това изискват да им бъде предоставен определен тип.

- -

Примери

- -

Случаи, предизвикващи грешката

- -
// Случаи, при които методът substring няма да работи.
-// Такива са undefined и null.
-var foo = undefined;
-foo.substring(1); // TypeError: foo is undefined
-
-var foo = null;
-foo.substring(1); // TypeError: foo is null
-
-
-// Методи, които очакват да бъдат извикани
-// върху точно определен тип.
-var foo = {}
-Symbol.keyFor(foo); // TypeError: foo is not a symbol
-
-var foo = 'bar'
-Object.create(foo); // TypeError: "foo" is not an object or null
-
- -

Поправяне на грешката

- -

За да оправите грешката в случай на указател, сочещ към стойност undefined или null, можете да използвате оператора typeof.

- -
if (typeof foo !== 'undefined') {
-  // Сега знаем, че foo има определена стойност
-  // и можем да продължим.
-}
- -

Вижте също

- - -- cgit v1.2.3-54-g00ecf