Date.prototype.toSource()

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

O método toSource() retorna uma cadeia de caracteres (string) representando o código fonte do objeto.

Sintaxe

dateObj.toSource()
Date.toSource()

Valor de retorno

Uma string representando o código fonte do objeto Date.

Exemplos

Função nativa

Para o objeto Date embutido, toSource() returna a seguinte string indicando que o código fonte não está disponível:

function Date() {
    [native code]
}

Especificações

Não faz parte de nenhum padrão.

Compatibilidade de navegador

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
toSource
Non-standard
Chrome No support NoEdge No support NoFirefox No support 1 — 74
Notes
No support 1 — 74
Notes
Notes Starting in Firefox 74, toSource() is no longer available for use by web content. It is still allowed for internal and privileged code.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support Nonodejs No support No

Legend

Full support  
Full support
No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.

Veja também