From 1109132f09d75da9a28b649c7677bb6ce07c40c0 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:45 -0500 Subject: initial commit --- .../constructor_internalerror/index.html | 55 ++++++++++++ .../objetos_globales/internalerror/index.html | 98 ++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 files/es/web/javascript/referencia/objetos_globales/internalerror/constructor_internalerror/index.html create mode 100644 files/es/web/javascript/referencia/objetos_globales/internalerror/index.html (limited to 'files/es/web/javascript/referencia/objetos_globales/internalerror') diff --git a/files/es/web/javascript/referencia/objetos_globales/internalerror/constructor_internalerror/index.html b/files/es/web/javascript/referencia/objetos_globales/internalerror/constructor_internalerror/index.html new file mode 100644 index 0000000000..ba895aaff9 --- /dev/null +++ b/files/es/web/javascript/referencia/objetos_globales/internalerror/constructor_internalerror/index.html @@ -0,0 +1,55 @@ +--- +title: Constructor InternalError() +slug: >- + Web/JavaScript/Referencia/Objetos_globales/InternalError/Constructor_InternalError +tags: + - Constructor + - JavaScript + - Referencia +translation_of: Web/JavaScript/Reference/Global_Objects/InternalError/InternalError +--- +
{{JSRef}} {{non-standard_header}}
+ +

El constructor InternalError() crea un error que indica un error que ocurrió internamente en el motor de JavaScript. Por ejemplo: "InternalError: demasiada recursividad".

+ +

Sintaxis

+ +
new InternalError([message[, fileName[, lineNumber]]])
+ +

Parámetros

+ +
+
message
+
Opcional. Una descripción del error legible para los humanos.
+
fileName
+
Opcional. El nombre del archivo que contiene el código que provocó la excepción.
+
lineNumber
+
Opcional. El número de línea del código que provocó la excepción.
+
+ +

Ejemplos

+ +

Crear un nuevo InternalError

+ +
new InternalError("Fallo del motor");
+
+ +

Especificaciones

+ +

No forma parte de ningún estándar.

+ +

Compatibilidad del navegador

+ +
+
+ + +

{{Compat("javascript.builtins.InternalError.InternalError")}}

+
+
+ +

Ve también

+ + diff --git a/files/es/web/javascript/referencia/objetos_globales/internalerror/index.html b/files/es/web/javascript/referencia/objetos_globales/internalerror/index.html new file mode 100644 index 0000000000..e7754d1575 --- /dev/null +++ b/files/es/web/javascript/referencia/objetos_globales/internalerror/index.html @@ -0,0 +1,98 @@ +--- +title: InternalError +slug: Web/JavaScript/Referencia/Objetos_globales/InternalError +tags: + - Clase + - Class + - InternalError + - JavaScript + - Objeto +translation_of: Web/JavaScript/Reference/Global_Objects/InternalError +--- +
{{JSRef}} {{non-standard_header}}
+ +

El objeto InternalError indica un error que se produjo internamente en el motor JavaScript.

+ +

Los principalmente casos de ejemplo son cuando algo es demasiado grande, por ejemplo:

+ + + +

Constructor

+ +
+
{{JSxRef("Global_Objects/InternalError/InternalError", "InternalError()")}}
+
Crea un nuevo objeto InternalError.
+
+ +

Propiedades de la instancia

+ +
+
{{jsxref("Error.prototype.message", "InternalError.prototype.message")}}
+
Mensaje de error. Heredado de {{JSxRef("Error")}}.
+
{{jsxref("Error.prototype.name", "InternalError.prototype.name")}}
+
Nombre del error. Heredado de {{JSxRef("Error")}}.
+
{{jsxref("Error.prototype.fileName", "InternalError.prototype.fileName")}}
+
Ruta al archivo que generó este error. Heredado de {{JSxRef("Error")}}.
+
{{jsxref("Error.prototype.lineNumber", "InternalError.prototype.lineNumber")}}
+
Número de línea en el archivo que generó este error. Heredado de {{JSxRef("Error")}}.
+
{{jsxref("Error.prototype.columnNumber", "InternalError.prototype.columnNumber")}}
+
Número de columna en la línea que generó este error. Heredado de {{JSxRef("Error")}}.
+
{{jsxref("Error.prototype.stack", "InternalError.prototype.stack")}}
+
Seguimiento de la pila. Heredado de {{JSxRef("Error")}}.
+
+ +

Ejemplos

+ +

Demasiada recursividad

+ +

Esta función recursiva se ejecuta 10 veces, según la condición de salida.

+ +
function loop(x) {
+  if (x >= 10) // "x >= 10" es la condición de salida
+    return;
+  // hacer cosas
+  loop(x + 1); // la llamada recursiva
+}
+loop(0);
+ +

Establecer esta condición en un valor extremadamente alto, no funcionará:

+ +
function loop(x) {
+  if (x >= 1000000000000)
+    return;
+  // hacer cosas
+  loop(x + 1);
+}
+loop(0);
+
+// InternalError: demasiada recursividad
+ +

Para obtener más información, consulta {{JSxRef("Errors/Too_much_recursion", "InternalError: demasiada recursividad.")}}

+ +

Especificaciones

+ +

No forma parte de ningún estándar.

+ +

Compatibilidad del navegador

+ +
+
+ + +

{{Compat("javascript.builtins.InternalError")}}

+
+
+ +

Ve también

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