Esta traducción está incompleta. Por favor, ayuda a traducir este artículo del inglés.
No estándar
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
El método toSource() devuelve un string representando el código fuente del objeto.
Sintaxis
function.toSource();
Function.toSource();
Parámetros
Ninguno.
Descripción
El método toSource devuelve los siguientes valores:
- For the built-in
Functionobject,toSource()devuelve la siguiente cadena indicando que el código fuente no está disponible:function Function() { [native code] } - En funciones personalizadas,
toSource()devuelve el código JavaScript que define el objeto como un string.
Éste método es usado de forma interna por JavaScript y no explicitamente desde el código. Puedes usar toSource mientras depuras para examinar el contenido de un objeto.
Especificaciones
No está reflejado en ningún estándar. Implementaso en JavaScript 1.3.
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | Not supported | (Yes) | ? | ? | ? |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | ? | ? | (Yes) | ? | ? | ? |